{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "view-in-github"
   },
   "source": [
    "<a href=\"https://colab.research.google.com/github/jalammar/ecco/blob/main/notebooks/Ecco_Input_Saliency.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Primary Attributions\n",
    "\n",
    "This notebook contains visualizations for primary attribution methods, by that means, methods that evaluate the contribution of each input feature to the output of a model.\n",
    "\n",
    "Now we are currently supporting:\n",
    "- Gradient saliency\n",
    "- Input X Gradient saliency\n",
    "- Integrated Gradients\n",
    "- DeepLift\n",
    "- DeepLife with SHAP\n",
    "- Guided Backpropagation\n",
    "- Guided GradCam\n",
    "- Deconvolution\n",
    "- Layer-wise Relevance Propagation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install ecco"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 215,
     "referenced_widgets": [
      "66ee7dd681184981a67e2b9dd5fdd6f0",
      "0e6405015df340b3bdc58694ebd4ecf4",
      "1198ffa7ad12484f9ac4048835321335",
      "819c4c5a5b3349bcade558a02106c0c4",
      "9254b1b515654fe9be6ffc08c2b15e4b",
      "ea23401f422c4201a2ccd2a45c426d52",
      "e0fcf661019f4e3da00175887b431ccc",
      "5e4aa51d413b4004bee30cce914d193e",
      "5fd6963056bf4687a15c941d3be3494b",
      "9a961b8a92334bedaeda460e4c92befc",
      "5a022265356840a5a3fb60ec1ab69d9f",
      "01e1163950684dc6b7fa868e7b9315a4",
      "6b92f7b5d29e4fa786f03c9a6267cec4",
      "a9682d37555846aeb124b69cf38092c3",
      "ff801625f32e452e84c2bcefccabbad3",
      "14dd95b6e25b462e87175be869146d05",
      "2d5ded1ce3034928b9675c598f5144e6",
      "03de4b4c35ce4b3a87f0b06743707c65",
      "31a4e3758a474c3da4a49bd5c4c396a4",
      "deaba8a37b4a40e2a5e42c8e4044f5ef",
      "41e537de9f8c4912a59ec4dc30e405f5",
      "a573b926127f471d90552617dbd355ac",
      "7d93ca3793fb43ba824f743aa9a7c208",
      "dde55076d6544256b821e4364e787a7f",
      "b54a170e8e20428dbd08dcbececa6174",
      "a7f991e0d30b4a2bbdf4efe3085b60ec",
      "59c41cdb09dc43448f8cf3b3edacc9f6",
      "a33793da690a401f84cfc27fe66b58d3",
      "6f42cc0bd0414b09994f8ca293b31db3",
      "ff151fd817e84f939614c8001ea02384",
      "bc6eb47a66bc4fbe88efa7878e1fd02e",
      "cdc358ab0d7b4cb3b911102f5b5ea48f"
     ]
    },
    "id": "zzcMoKUkV3aH",
    "outputId": "e88438a9-112f-4dfe-9897-88a589e42218"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ola/our_ecco/ecco/venv/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at  ../c10/cuda/CUDAFunctions.cpp:115.)\n",
      "  return torch._C._cuda_getDeviceCount() > 0\n"
     ]
    }
   ],
   "source": [
    "import ecco\n",
    "lm = ecco.from_pretrained('distilgpt2')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 334
    },
    "id": "T9bZBZLq-93C",
    "outputId": "e6f3398b-5e9e-456d-d5a4-3331764fea9c"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html lang=\"en\">\n",
       "<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
       "<script>\n",
       "    var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
       "    // var ecco_url = 'http://localhost:8000/ecco/'\n",
       "\n",
       "    if (window.ecco === undefined) window.ecco = {}\n",
       "\n",
       "    requirejs.config({\n",
       "        urlArgs: \"bust=\" + (new Date()).getTime(),\n",
       "        nodeRequire: require,\n",
       "        paths: {\n",
       "            d3: \"https://d3js.org/d3.v5.min\",\n",
       "            \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
       "            jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
       "            // oldEcco: ecco_url + 'ecco',\n",
       "            ecco: ecco_url + 'js/0.0.4/ecco-bundle.min',\n",
       "            xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
       "        }\n",
       "    });\n",
       "    requirejs(['d3'],\n",
       "        function (d3) {\n",
       "            d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
       "        })\n",
       "\n",
       "    console.log('Ecco initialize.')\n",
       "</script>\n",
       "\n",
       "<head>\n",
       "    <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
       "</head>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    // console.log('defining basic')\n",
       "    define('basic', ['d3'],\n",
       "        function (d3) {\n",
       "            return {\n",
       "                init: function (viz_id = null) {\n",
       "\n",
       "                    // console.log('basic init')\n",
       "                    if (viz_id == null){\n",
       "                        viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
       "                    }\n",
       "                    const div = d3.select('#basic').attr('id', viz_id),\n",
       "                        div_parent = d3.select('#' + viz_id).node().parentNode\n",
       "\n",
       "                    // Link to CSS file\n",
       "                    d3.select(div_parent).insert('link')\n",
       "                        .attr('rel', 'stylesheet')\n",
       "                        .attr('type', 'text/css')\n",
       "                        .attr('href', ecco_url + 'html/styles.css')\n",
       "\n",
       "                    return viz_id\n",
       "                }\n",
       "            }\n",
       "        }, function (err) {console.log(err);}\n",
       "    )\n",
       "    // console.log('after defining basic')\n",
       "\n",
       "</script>\n",
       "<div id=\"basic\"></div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "         requirejs( ['basic', 'ecco'], function(basic, ecco){\n",
       "            basic.init('viz_282424')\n",
       "\n",
       "            window.ecco['viz_282424'] = ecco.renderOutputSequence('viz_282424', {'tokens': [{'token': 'The', 'position': 0, 'token_id': 464, 'type': 'input'}, {'token': ' countries', 'position': 1, 'token_id': 2678, 'type': 'input'}, {'token': ' of', 'position': 2, 'token_id': 286, 'type': 'input'}, {'token': ' the', 'position': 3, 'token_id': 262, 'type': 'input'}, {'token': ' European', 'position': 4, 'token_id': 3427, 'type': 'input'}, {'token': ' Union', 'position': 5, 'token_id': 4479, 'type': 'input'}, {'token': ' are', 'position': 6, 'token_id': 389, 'type': 'input'}, {'token': ':', 'position': 7, 'token_id': 25, 'type': 'input'}, {'token': '\\n', 'position': 8, 'token_id': 198, 'type': 'input'}, {'token': '1', 'position': 9, 'token_id': 16, 'type': 'input'}, {'token': '.', 'position': 10, 'token_id': 13, 'type': 'input'}, {'token': ' Austria', 'position': 11, 'token_id': 17322, 'type': 'input'}, {'token': '\\n', 'position': 12, 'token_id': 198, 'type': 'input'}, {'token': '2', 'position': 13, 'token_id': 17, 'type': 'input'}, {'token': '.', 'position': 14, 'token_id': 13, 'type': 'input'}, {'token': ' Belgium', 'position': 15, 'token_id': 15664, 'type': 'input'}, {'token': '\\n', 'position': 16, 'token_id': 198, 'type': 'input'}, {'token': '3', 'position': 17, 'token_id': 18, 'type': 'input'}, {'token': '.', 'position': 18, 'token_id': 13, 'type': 'input'}, {'token': ' Bulgaria', 'position': 19, 'token_id': 27902, 'type': 'input'}, {'token': '\\n', 'position': 20, 'token_id': 198, 'type': 'input'}, {'token': '4', 'position': 21, 'token_id': 19, 'type': 'input'}, {'token': '.', 'position': 22, 'token_id': 13, 'type': 'input'}]})\n",
       "         }, function (err) {\n",
       "            console.log(err);\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Czech\", \"token_id\": 16639, \"position\": 23, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Republic\", \"token_id\": 2066, \"position\": 24, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"\\n\", \"token_id\": 198, \"position\": 25, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"5\", \"token_id\": 20, \"position\": 26, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \".\", \"token_id\": 13, \"position\": 27, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Denmark\", \"token_id\": 16490, \"position\": 28, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"\\n\", \"token_id\": 198, \"position\": 29, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"6\", \"token_id\": 21, \"position\": 30, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \".\", \"token_id\": 13, \"position\": 31, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Finland\", \"token_id\": 17837, \"position\": 32, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"\\n\", \"token_id\": 198, \"position\": 33, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"7\", \"token_id\": 22, \"position\": 34, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \".\", \"token_id\": 13, \"position\": 35, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Malta\", \"token_id\": 35206, \"position\": 36, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"\\n\", \"token_id\": 198, \"position\": 37, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"8\", \"token_id\": 23, \"position\": 38, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \".\", \"token_id\": 13, \"position\": 39, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \" Portugal\", \"token_id\": 19101, \"position\": 40, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"\\n\", \"token_id\": 198, \"position\": 41, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "        // We don't really need these require scripts. But this is to avert\n",
       "        //this code from running before display_input_sequence which DOES require external files\n",
       "        requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                console.log('addToken viz_id', 'viz_282424');\n",
       "                window.ecco['viz_282424'].addToken({\"token\": \"9\", \"token_id\": 24, \"position\": 42, \"type\": \"output\"})\n",
       "                window.ecco['viz_282424'].redraw()\n",
       "        })\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "text= \"The countries of the European Union are:\\n1. Austria\\n2. Belgium\\n3. Bulgaria\\n4.\"\n",
    "\n",
    "# Pass in `attribution` argument the list of primary attributions to be computed\n",
    "# With ['ig', 'grad_x_input'] we are calculating Integrated Gradients and Input X Gradient saliency attributions\n",
    "output = lm.generate(text, generate=20, do_sample=True, attribution=['ig', 'grad_x_input'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 234
    },
    "id": "3a02pyc2WASq",
    "outputId": "ac3e4d15-f2fb-4f4e-9bf7-0882a6c895c2"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html lang=\"en\">\n",
       "<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
       "<script>\n",
       "    var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
       "    // var ecco_url = 'http://localhost:8000/ecco/'\n",
       "\n",
       "    if (window.ecco === undefined) window.ecco = {}\n",
       "\n",
       "    requirejs.config({\n",
       "        urlArgs: \"bust=\" + (new Date()).getTime(),\n",
       "        nodeRequire: require,\n",
       "        paths: {\n",
       "            d3: \"https://d3js.org/d3.v5.min\",\n",
       "            \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
       "            jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
       "            // oldEcco: ecco_url + 'ecco',\n",
       "            ecco: ecco_url + 'js/0.0.4/ecco-bundle.min',\n",
       "            xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
       "        }\n",
       "    });\n",
       "    requirejs(['d3'],\n",
       "        function (d3) {\n",
       "            d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
       "        })\n",
       "\n",
       "    console.log('Ecco initialize.')\n",
       "</script>\n",
       "\n",
       "<head>\n",
       "    <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
       "</head>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    // console.log('defining basic')\n",
       "    define('basic', ['d3'],\n",
       "        function (d3) {\n",
       "            return {\n",
       "                init: function (viz_id = null) {\n",
       "\n",
       "                    // console.log('basic init')\n",
       "                    if (viz_id == null){\n",
       "                        viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
       "                    }\n",
       "                    const div = d3.select('#basic').attr('id', viz_id),\n",
       "                        div_parent = d3.select('#' + viz_id).node().parentNode\n",
       "\n",
       "                    // Link to CSS file\n",
       "                    d3.select(div_parent).insert('link')\n",
       "                        .attr('rel', 'stylesheet')\n",
       "                        .attr('type', 'text/css')\n",
       "                        .attr('href', ecco_url + 'html/styles.css')\n",
       "\n",
       "                    return viz_id\n",
       "                }\n",
       "            }\n",
       "        }, function (err) {console.log(err);}\n",
       "    )\n",
       "    // console.log('after defining basic')\n",
       "\n",
       "</script>\n",
       "<div id=\"basic\"></div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "             requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                const viz_id = basic.init()\n",
       "                // ecco.interactiveTokens(viz_id, {})\n",
       "                window.ecco[viz_id] = new ecco.MinimalHighlighter({\n",
       "                parentDiv: viz_id,\n",
       "                data: {'tokens': [{'token': 'The', 'token_id': 464, 'type': 'input', 'value': '0.03816325659898114', 'position': 0}, {'token': ' countries', 'token_id': 2678, 'type': 'input', 'value': '0.04485683941936176', 'position': 1}, {'token': ' of', 'token_id': 286, 'type': 'input', 'value': '0.018770602228892288', 'position': 2}, {'token': ' the', 'token_id': 262, 'type': 'input', 'value': '0.012321895183562321', 'position': 3}, {'token': ' European', 'token_id': 3427, 'type': 'input', 'value': '0.04038441889983899', 'position': 4}, {'token': ' Union', 'token_id': 4479, 'type': 'input', 'value': '0.027187176177062865', 'position': 5}, {'token': ' are', 'token_id': 389, 'type': 'input', 'value': '0.014939194135626175', 'position': 6}, {'token': ':', 'token_id': 25, 'type': 'input', 'value': '0.01780878712189199', 'position': 7}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.022024434825352754', 'position': 8}, {'token': '1', 'token_id': 16, 'type': 'input', 'value': '0.01953061940565476', 'position': 9}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.015273648756695745', 'position': 10}, {'token': ' Austria', 'token_id': 17322, 'type': 'input', 'value': '0.06870788835444404', 'position': 11}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.030811432773188815', 'position': 12}, {'token': '2', 'token_id': 17, 'type': 'input', 'value': '0.024293020967353796', 'position': 13}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.018030779999945894', 'position': 14}, {'token': ' Belgium', 'token_id': 15664, 'type': 'input', 'value': '0.10826002953835284', 'position': 15}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.01896631030834879', 'position': 16}, {'token': '3', 'token_id': 18, 'type': 'input', 'value': '0.01856877118936424', 'position': 17}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.020773996355417407', 'position': 18}, {'token': ' Bulgaria', 'token_id': 27902, 'type': 'input', 'value': '0.3227535653029056', 'position': 19}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.025542212499585108', 'position': 20}, {'token': '4', 'token_id': 19, 'type': 'input', 'value': '0.0398622260203101', 'position': 21}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.03216889393786256', 'position': 22}, {'token': ' Czech', 'token_id': 16639, 'type': 'output', 'value': '0', 'position': 23}, {'token': ' Republic', 'token_id': 2066, 'type': 'output', 'value': '0', 'position': 24}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 25}, {'token': '5', 'token_id': 20, 'type': 'output', 'value': '0', 'position': 26}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 27}, {'token': ' Denmark', 'token_id': 16490, 'type': 'output', 'value': '0', 'position': 28}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 29}, {'token': '6', 'token_id': 21, 'type': 'output', 'value': '0', 'position': 30}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 31}, {'token': ' Finland', 'token_id': 17837, 'type': 'output', 'value': '0', 'position': 32}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 33}, {'token': '7', 'token_id': 22, 'type': 'output', 'value': '0', 'position': 34}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 35}, {'token': ' Malta', 'token_id': 35206, 'type': 'output', 'value': '0', 'position': 36}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 37}, {'token': '8', 'token_id': 23, 'type': 'output', 'value': '0', 'position': 38}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 39}, {'token': ' Portugal', 'token_id': 19101, 'type': 'output', 'value': '0', 'position': 40}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 41}, {'token': '9', 'token_id': 24, 'type': 'output', 'value': '0', 'position': 42}], 'attributions': [[0.03816325659898114, 0.04485683941936176, 0.018770602228892288, 0.012321895183562321, 0.04038441889983899, 0.027187176177062865, 0.014939194135626175, 0.01780878712189199, 0.022024434825352754, 0.01953061940565476, 0.015273648756695745, 0.06870788835444404, 0.030811432773188815, 0.024293020967353796, 0.018030779999945894, 0.10826002953835284, 0.01896631030834879, 0.01856877118936424, 0.020773996355417407, 0.3227535653029056, 0.025542212499585108, 0.0398622260203101, 0.03216889393786256], [0.03356854596682211, 0.039151739732032995, 0.029228802496124126, 0.018527658168107333, 0.028150240541935618, 0.025323406902877234, 0.016878003401156954, 0.022311751195628757, 0.03657311280878972, 0.024964752653788273, 0.020555571224773583, 0.06905722307680436, 0.041805241978895194, 0.02437447146665573, 0.017461582116750966, 0.07650292631902632, 0.027489217620829433, 0.01612326516649157, 0.016274025388636603, 0.06712416327391814, 0.02109270479670383, 0.029187603539893123, 0.03667696025925642, 0.2615970299041016], [0.07143582743010654, 0.03795342610369315, 0.03562509559581455, 0.024973211321331287, 0.03661075782314724, 0.0348176410971063, 0.020320852699016026, 0.02513800218814171, 0.030513458680212335, 0.027526377275662737, 0.021808023364822553, 0.04930110226582615, 0.042917454857613654, 0.027861972805667094, 0.019156342596903225, 0.06138195233673923, 0.04723242625154431, 0.02203957394006854, 0.01511247461578667, 0.06033658128274698, 0.048246426227623034, 0.023116794633402188, 0.024359496110357978, 0.09371264936843905, 0.09850207912822738], [0.03298532057181011, 0.030422608427300792, 0.06296929862106472, 0.01927554749514607, 0.026759024583823565, 0.025292171500871777, 0.0236380228286462, 0.020395376516767916, 0.024617275843020887, 0.07190130887293232, 0.028357096558612894, 0.02498464921647124, 0.021634008332033525, 0.13712306058301865, 0.013260603836038559, 0.015960283816842075, 0.01965715227235756, 0.09969204971091344, 0.009860028219411008, 0.0225658147734015, 0.022401231223673268, 0.16867568198693847, 0.013002589827328404, 0.03253932110913485, 0.017176111493804994, 0.014854361778635394], [0.07805083354779466, 0.04341978170040821, 0.03264199666094037, 0.0231670654405534, 0.033830786343621216, 0.030576424094651975, 0.023502465499232888, 0.02595144149188776, 0.026700627371656134, 0.02749516048957498, 0.027499449161542875, 0.027659195999392334, 0.027755303553406132, 0.03198775233405264, 0.03130448442370603, 0.02946737524336084, 0.027135055331895034, 0.04091777098637475, 0.035466585409128254, 0.028885572413487253, 0.03206532840320689, 0.07618588406959917, 0.06785122467702173, 0.023160262351600625, 0.02181595992179754, 0.0456295519877655, 0.07987666109234073], [0.03285239743346724, 0.04238700334617747, 0.010586511110761856, 0.009264262003424725, 0.04831343828189751, 0.023253474571556534, 0.009378409965910392, 0.012532313626729094, 0.013539127697606845, 0.012364340937448148, 0.014049115263945552, 0.04442633139504016, 0.011185727146706518, 0.011219031175923431, 0.012542279793466584, 0.053295799196204266, 0.013149709853661493, 0.01692274850452728, 0.014348528248331268, 0.11165965326339286, 0.02072769903152562, 0.017798762110702537, 0.01865911547997833, 0.30226948448997776, 0.0224174852436065, 0.02845558911212413, 0.04122442309936595, 0.031177238616539905], [0.06221314137977198, 0.04035407615542907, 0.03609673172714655, 0.027739999415806446, 0.03962971289399191, 0.034485248728940154, 0.02147169260349363, 0.025582777921649466, 0.031951966862763026, 0.02560538741585001, 0.021343942521297826, 0.05292094148467818, 0.04136292730503346, 0.024899527965053753, 0.01968924941961817, 0.0663307275961328, 0.04798784741120012, 0.02148479126516998, 0.016917474106208755, 0.06908433739703358, 0.04650965170852411, 0.014678668060464235, 0.010470969334562768, 0.030416689727069006, 0.025575459413846122, 0.038313383177523024, 0.020240633735770137, 0.01680661311241666, 0.0698354301535549], [0.029520797611034186, 0.03280984489985847, 0.04799069483406048, 0.016769945270912846, 0.024723340517737433, 0.0213684696120684, 0.020910800769546097, 0.01998168319337377, 0.0220123412953076, 0.05473775243140476, 0.025569555107653474, 0.025921993257765258, 0.019826799620634643, 0.0935158987872341, 0.012243423517336437, 0.015873179858335317, 0.018440729811493115, 0.06994620114906412, 0.01079927607115328, 0.025679506386212737, 0.018334722680824322, 0.08717603692161124, 0.011671357632720317, 0.032654794245515935, 0.01849269313916095, 0.026558773749769157, 0.12893536372814224, 0.01322097947674063, 0.03848326386617845, 0.01582978055715025], [0.06441903728776993, 0.041124216064522795, 0.031923888105929214, 0.02204908089179162, 0.032613640439093254, 0.02830385899084401, 0.019900928829719087, 0.021996284872840385, 0.022262544788175968, 0.021206164039790303, 0.022122130792618114, 0.02433335298462723, 0.02191152668152203, 0.025432747188107417, 0.025512402979789326, 0.026177116034691972, 0.021359398222911684, 0.029556737971948403, 0.02584079434076926, 0.025662779089392056, 0.022267417396839136, 0.04748420766010813, 0.04330734169691333, 0.023719841615770457, 0.024823570413109453, 0.027085859733277495, 0.03363256711217583, 0.03081957002552335, 0.035200346757438376, 0.05315336497671798, 0.10479728201527241], [0.026513928651264087, 0.03996917549664565, 0.01336795191617863, 0.010597158012240608, 0.04237416079809983, 0.023763557627826, 0.008221771040211401, 0.009221280920650185, 0.009150429807902939, 0.010111475668547514, 0.008101869652523458, 0.03677428507743584, 0.008289414587737038, 0.009778549749367605, 0.007703805300656185, 0.06010964273600191, 0.008879772857145123, 0.011388392216368422, 0.008067562450328726, 0.09153109834999053, 0.009388531384721307, 0.011134951236827827, 0.00956483393465031, 0.12388904673862935, 0.013818657777519864, 0.011759429344424652, 0.01545819708295023, 0.013123264623761257, 0.2816658448974558, 0.009934198979630255, 0.03318202059621369, 0.023165740486093794], [0.05527320581444954, 0.03985341981678364, 0.03235298654446862, 0.027144944126741392, 0.03843480710787998, 0.03109095833162721, 0.020638240861950884, 0.024596846921929653, 0.030455982480456594, 0.022957420402903116, 0.018587627070486307, 0.045464092954121876, 0.035968364824018925, 0.024309060897302424, 0.017190176758570944, 0.05426550707220189, 0.04065017139277534, 0.022347336288523516, 0.016219078758086015, 0.061129419503222, 0.03963798107741524, 0.017390045008918286, 0.012379769297468477, 0.030319509150308156, 0.021345550133168214, 0.02770792531639662, 0.014707599585315756, 0.010161270660708686, 0.02618361149979908, 0.030936126282389936, 0.018493118411428245, 0.016388875782210096, 0.07541896986597323], [0.028604801002755496, 0.025196027324244783, 0.04535564967265759, 0.015042571355065773, 0.0253303627331166, 0.02113174846166937, 0.018956051830727825, 0.017419019501773512, 0.02023461134175331, 0.04528755690630328, 0.024829193826920764, 0.01964395416310902, 0.016835016353966822, 0.08095601380115533, 0.014768383876332225, 0.014534612986943597, 0.01412567975359456, 0.06321386553457962, 0.010248442151915962, 0.02020355105684127, 0.012323673418761331, 0.07051399581029677, 0.008180605737939259, 0.014647010663558563, 0.011638164213219008, 0.013623073041649628, 0.08870950991726519, 0.007701713194232714, 0.013349381726738505, 0.016396629349832707, 0.15157878282899045, 0.00598529439448228, 0.03204134295994345, 0.011393709107663425], [0.055056951133384546, 0.03327171757863513, 0.026115594175049647, 0.018571004312752437, 0.02655104622484275, 0.022729516197158284, 0.018672438877486847, 0.019096251252306434, 0.0258496906875435, 0.018537624648051115, 0.022421832368904562, 0.024952902842440228, 0.024646684061357397, 0.02553588062753793, 0.02348346716593885, 0.024558776436320057, 0.022823594513823788, 0.02712895274964992, 0.022587062070070635, 0.026247820217751777, 0.022484531256485616, 0.04012478423799349, 0.03213869427137696, 0.024823181589918766, 0.02413996197086686, 0.02861705803808665, 0.035784301227839606, 0.038505589727573106, 0.02580730514791181, 0.026507453189903562, 0.03219930104710535, 0.034136049933238, 0.029385515454451692, 0.03762121631555652, 0.05888624845068611], [0.029205943891571724, 0.029347661704450134, 0.009838275561310655, 0.009602464921021443, 0.03263746331446067, 0.020433761212861026, 0.01130490670259332, 0.01184901333066446, 0.01796190273168147, 0.0131068952023176, 0.015070518945382463, 0.06729813746025508, 0.011878667712935368, 0.013500651808379328, 0.010550680451296252, 0.05451186965640294, 0.011961710634348581, 0.01073257122258376, 0.01027470208354395, 0.061364805825737605, 0.008301138166219928, 0.010733987768719751, 0.007677867560981801, 0.04777003752991944, 0.0116287070884541, 0.01008251284314948, 0.01365588950529145, 0.010466767641604669, 0.10649904538779335, 0.012668998936889938, 0.019249581298600334, 0.013833703703392337, 0.18181207897936613, 0.017838251640128023, 0.04450591937043558, 0.030842908205255964], [0.05600816870849343, 0.036486563571139594, 0.03259601368337945, 0.028881956568237235, 0.035421801357631004, 0.029029653033139688, 0.01957344704877028, 0.02314110879561195, 0.028182487350039868, 0.01905626295557975, 0.015183531576145243, 0.03328716950551948, 0.029895299789270673, 0.01824382111574043, 0.014201543582820825, 0.03616711103919022, 0.031680212001509674, 0.018071817065111042, 0.014655408172707796, 0.04355873896082935, 0.034169751826506486, 0.018336817155476928, 0.012224884985489607, 0.028070950397248034, 0.02011471784137302, 0.029285600409118238, 0.01659500376416177, 0.011930882738352758, 0.024247208727367436, 0.027916271762691375, 0.01862791748394554, 0.009699461853488571, 0.028074287616200268, 0.03520978976414255, 0.015218178003292122, 0.017318143548209427, 0.089638016242069], [0.024876340572622717, 0.02073237813294803, 0.03228543045952525, 0.012506722912544673, 0.018254871252460204, 0.01588442808394393, 0.014337218283803462, 0.013374567647804675, 0.017658386270452898, 0.033507027054220935, 0.019483623754524244, 0.015405548533093026, 0.013742646260982355, 0.06458243967090431, 0.012706480531367415, 0.011949818927808113, 0.011292717834778898, 0.04175864389687742, 0.008290162394041624, 0.018854569551775127, 0.01074442492833296, 0.04890260305697074, 0.006030236720307029, 0.009636683115558674, 0.009422886880231334, 0.010575497827085799, 0.05195444917923404, 0.007716759730369863, 0.01823787933588457, 0.01421164597163132, 0.0749133924366528, 0.009717704021195993, 0.05010304511262495, 0.020880654695473514, 0.18634696492032676, 0.0053291940051680056, 0.03213492906428976, 0.011657026972182523], [0.04951829556069409, 0.0337880145784422, 0.025647231021833656, 0.019414847222696062, 0.029095084216310834, 0.025034358940539226, 0.015535601692538998, 0.01681253876883839, 0.01800433598684106, 0.013422528761427027, 0.016342800269392874, 0.020584402965991955, 0.01422751307266618, 0.014882243804467763, 0.016707586455164423, 0.021179763987091316, 0.014002307711422815, 0.016638836904110575, 0.014843808672460376, 0.020838333613116163, 0.014711754178840087, 0.02208412515733296, 0.0214287278031274, 0.022172745951932193, 0.022618524003011103, 0.01855148020020462, 0.025031722721920672, 0.025639978213495757, 0.028539481991283023, 0.02335730841502124, 0.03304438898364873, 0.030634798729525396, 0.03139807518280172, 0.029819868476032, 0.026994829925925175, 0.027343877810664798, 0.04437798209982799, 0.04272074613050459, 0.09300914981885457], [0.014738321705615023, 0.016796524572112226, 0.005678127972004815, 0.004596057014882546, 0.02069128217272541, 0.012744805699992593, 0.005710013515116223, 0.006840817019345103, 0.007546536286077329, 0.00798847494907962, 0.0063925201572581185, 0.02864791960346581, 0.006303500412751308, 0.0065769250247910095, 0.005592139975526253, 0.02298646847274753, 0.007238450393083181, 0.008260564044618836, 0.005641225739487664, 0.02603052137252563, 0.007812171256213309, 0.008958762233139307, 0.005746863326886982, 0.027531786464090553, 0.011123063498879605, 0.013041574818298117, 0.015577985313908688, 0.011609426488244418, 0.07582147842657143, 0.016591683638387988, 0.02228036858234722, 0.014242314485823407, 0.10254995087651353, 0.022515984946287846, 0.028118587788115233, 0.022817744841459837, 0.2869745820325402, 0.025166571594421833, 0.03652673503557285, 0.01799116824909139], [0.0525085418213818, 0.035648796945815305, 0.029231744370858914, 0.026736516780216678, 0.03414634824333371, 0.02723074923421281, 0.019265327427185015, 0.02231811858094469, 0.026333108099529996, 0.01841888241157141, 0.015062320494875124, 0.0321756284610581, 0.026885030681228633, 0.017341132000439418, 0.012550600118072967, 0.03390537766576998, 0.027888059098871414, 0.016875816676121397, 0.012836882964477596, 0.04058241920599976, 0.029198232603526362, 0.017441007611477398, 0.011279184065980502, 0.03009012409598985, 0.01910840524461543, 0.025087430787301614, 0.01672853052632543, 0.011447803473598606, 0.02200611058064954, 0.022504758191420927, 0.018428358862468488, 0.009370584229085007, 0.023580455263937147, 0.022720521736298262, 0.015032168972650107, 0.008419022198377785, 0.037194158912755945, 0.025122115255822062, 0.018374625202931236, 0.015292017280035264, 0.07363298362278829], [0.02136553273648282, 0.022090043303421347, 0.025535939756691942, 0.010933642072461863, 0.018593577056058186, 0.016599077945778976, 0.012257269662757945, 0.011416775641411659, 0.013625903572152225, 0.02469046987767595, 0.01456821682581472, 0.015363684349107867, 0.011896493798297833, 0.04673759894978191, 0.01001647267189606, 0.010828529446411229, 0.009168034316706623, 0.030405419935462984, 0.008552247691452358, 0.018527540911872784, 0.009494964065700157, 0.02762511997454346, 0.005586260596654724, 0.009917022725701313, 0.009155411603429964, 0.010460353167737028, 0.045066273381454365, 0.007333697946395677, 0.024642519020658966, 0.013473455432104589, 0.0666089397094416, 0.009229875694080118, 0.025299726886564337, 0.014610875595352402, 0.13272736326790086, 0.011157920321485248, 0.02390653694229902, 0.01925646799969419, 0.1072592216551453, 0.007465498829081969, 0.05423285847098162, 0.01231716619189573]]},\n",
       "                preset: 'viridis'\n",
       "             })\n",
       "\n",
       "             window.ecco[viz_id].init();\n",
       "             window.ecco[viz_id].selectFirstToken();\n",
       "\n",
       "             }, function (err) {\n",
       "                console.log(err);\n",
       "            })"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output.primary_attributions(attr_method='ig')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 357
    },
    "id": "rRM7NKV91TCk",
    "outputId": "cb209195-cea3-4402-ef3c-ead36f0d405f"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html lang=\"en\">\n",
       "<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
       "<script>\n",
       "    var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
       "    // var ecco_url = 'http://localhost:8000/ecco/'\n",
       "\n",
       "    if (window.ecco === undefined) window.ecco = {}\n",
       "\n",
       "    requirejs.config({\n",
       "        urlArgs: \"bust=\" + (new Date()).getTime(),\n",
       "        nodeRequire: require,\n",
       "        paths: {\n",
       "            d3: \"https://d3js.org/d3.v5.min\",\n",
       "            \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
       "            jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
       "            // oldEcco: ecco_url + 'ecco',\n",
       "            ecco: ecco_url + 'js/0.0.4/ecco-bundle.min',\n",
       "            xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
       "        }\n",
       "    });\n",
       "    requirejs(['d3'],\n",
       "        function (d3) {\n",
       "            d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
       "        })\n",
       "\n",
       "    console.log('Ecco initialize.')\n",
       "</script>\n",
       "\n",
       "<head>\n",
       "    <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
       "</head>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    // console.log('defining basic')\n",
       "    define('basic', ['d3'],\n",
       "        function (d3) {\n",
       "            return {\n",
       "                init: function (viz_id = null) {\n",
       "\n",
       "                    // console.log('basic init')\n",
       "                    if (viz_id == null){\n",
       "                        viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
       "                    }\n",
       "                    const div = d3.select('#basic').attr('id', viz_id),\n",
       "                        div_parent = d3.select('#' + viz_id).node().parentNode\n",
       "\n",
       "                    // Link to CSS file\n",
       "                    d3.select(div_parent).insert('link')\n",
       "                        .attr('rel', 'stylesheet')\n",
       "                        .attr('type', 'text/css')\n",
       "                        .attr('href', ecco_url + 'html/styles.css')\n",
       "\n",
       "                    return viz_id\n",
       "                }\n",
       "            }\n",
       "        }, function (err) {console.log(err);}\n",
       "    )\n",
       "    // console.log('after defining basic')\n",
       "\n",
       "</script>\n",
       "<div id=\"basic\"></div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "             requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                const viz_id = basic.init()\n",
       "                window.ecco[viz_id] = ecco.interactiveTokens(viz_id, {'tokens': [{'token': 'The', 'token_id': 464, 'type': 'input', 'value': '0.03816325659898114', 'position': 0}, {'token': ' countries', 'token_id': 2678, 'type': 'input', 'value': '0.04485683941936176', 'position': 1}, {'token': ' of', 'token_id': 286, 'type': 'input', 'value': '0.018770602228892288', 'position': 2}, {'token': ' the', 'token_id': 262, 'type': 'input', 'value': '0.012321895183562321', 'position': 3}, {'token': ' European', 'token_id': 3427, 'type': 'input', 'value': '0.04038441889983899', 'position': 4}, {'token': ' Union', 'token_id': 4479, 'type': 'input', 'value': '0.027187176177062865', 'position': 5}, {'token': ' are', 'token_id': 389, 'type': 'input', 'value': '0.014939194135626175', 'position': 6}, {'token': ':', 'token_id': 25, 'type': 'input', 'value': '0.01780878712189199', 'position': 7}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.022024434825352754', 'position': 8}, {'token': '1', 'token_id': 16, 'type': 'input', 'value': '0.01953061940565476', 'position': 9}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.015273648756695745', 'position': 10}, {'token': ' Austria', 'token_id': 17322, 'type': 'input', 'value': '0.06870788835444404', 'position': 11}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.030811432773188815', 'position': 12}, {'token': '2', 'token_id': 17, 'type': 'input', 'value': '0.024293020967353796', 'position': 13}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.018030779999945894', 'position': 14}, {'token': ' Belgium', 'token_id': 15664, 'type': 'input', 'value': '0.10826002953835284', 'position': 15}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.01896631030834879', 'position': 16}, {'token': '3', 'token_id': 18, 'type': 'input', 'value': '0.01856877118936424', 'position': 17}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.020773996355417407', 'position': 18}, {'token': ' Bulgaria', 'token_id': 27902, 'type': 'input', 'value': '0.3227535653029056', 'position': 19}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.025542212499585108', 'position': 20}, {'token': '4', 'token_id': 19, 'type': 'input', 'value': '0.0398622260203101', 'position': 21}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.03216889393786256', 'position': 22}, {'token': ' Czech', 'token_id': 16639, 'type': 'output', 'value': '0', 'position': 23}, {'token': ' Republic', 'token_id': 2066, 'type': 'output', 'value': '0', 'position': 24}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 25}, {'token': '5', 'token_id': 20, 'type': 'output', 'value': '0', 'position': 26}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 27}, {'token': ' Denmark', 'token_id': 16490, 'type': 'output', 'value': '0', 'position': 28}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 29}, {'token': '6', 'token_id': 21, 'type': 'output', 'value': '0', 'position': 30}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 31}, {'token': ' Finland', 'token_id': 17837, 'type': 'output', 'value': '0', 'position': 32}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 33}, {'token': '7', 'token_id': 22, 'type': 'output', 'value': '0', 'position': 34}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 35}, {'token': ' Malta', 'token_id': 35206, 'type': 'output', 'value': '0', 'position': 36}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 37}, {'token': '8', 'token_id': 23, 'type': 'output', 'value': '0', 'position': 38}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 39}, {'token': ' Portugal', 'token_id': 19101, 'type': 'output', 'value': '0', 'position': 40}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 41}, {'token': '9', 'token_id': 24, 'type': 'output', 'value': '0', 'position': 42}], 'attributions': [[0.03816325659898114, 0.04485683941936176, 0.018770602228892288, 0.012321895183562321, 0.04038441889983899, 0.027187176177062865, 0.014939194135626175, 0.01780878712189199, 0.022024434825352754, 0.01953061940565476, 0.015273648756695745, 0.06870788835444404, 0.030811432773188815, 0.024293020967353796, 0.018030779999945894, 0.10826002953835284, 0.01896631030834879, 0.01856877118936424, 0.020773996355417407, 0.3227535653029056, 0.025542212499585108, 0.0398622260203101, 0.03216889393786256], [0.03356854596682211, 0.039151739732032995, 0.029228802496124126, 0.018527658168107333, 0.028150240541935618, 0.025323406902877234, 0.016878003401156954, 0.022311751195628757, 0.03657311280878972, 0.024964752653788273, 0.020555571224773583, 0.06905722307680436, 0.041805241978895194, 0.02437447146665573, 0.017461582116750966, 0.07650292631902632, 0.027489217620829433, 0.01612326516649157, 0.016274025388636603, 0.06712416327391814, 0.02109270479670383, 0.029187603539893123, 0.03667696025925642, 0.2615970299041016], [0.07143582743010654, 0.03795342610369315, 0.03562509559581455, 0.024973211321331287, 0.03661075782314724, 0.0348176410971063, 0.020320852699016026, 0.02513800218814171, 0.030513458680212335, 0.027526377275662737, 0.021808023364822553, 0.04930110226582615, 0.042917454857613654, 0.027861972805667094, 0.019156342596903225, 0.06138195233673923, 0.04723242625154431, 0.02203957394006854, 0.01511247461578667, 0.06033658128274698, 0.048246426227623034, 0.023116794633402188, 0.024359496110357978, 0.09371264936843905, 0.09850207912822738], [0.03298532057181011, 0.030422608427300792, 0.06296929862106472, 0.01927554749514607, 0.026759024583823565, 0.025292171500871777, 0.0236380228286462, 0.020395376516767916, 0.024617275843020887, 0.07190130887293232, 0.028357096558612894, 0.02498464921647124, 0.021634008332033525, 0.13712306058301865, 0.013260603836038559, 0.015960283816842075, 0.01965715227235756, 0.09969204971091344, 0.009860028219411008, 0.0225658147734015, 0.022401231223673268, 0.16867568198693847, 0.013002589827328404, 0.03253932110913485, 0.017176111493804994, 0.014854361778635394], [0.07805083354779466, 0.04341978170040821, 0.03264199666094037, 0.0231670654405534, 0.033830786343621216, 0.030576424094651975, 0.023502465499232888, 0.02595144149188776, 0.026700627371656134, 0.02749516048957498, 0.027499449161542875, 0.027659195999392334, 0.027755303553406132, 0.03198775233405264, 0.03130448442370603, 0.02946737524336084, 0.027135055331895034, 0.04091777098637475, 0.035466585409128254, 0.028885572413487253, 0.03206532840320689, 0.07618588406959917, 0.06785122467702173, 0.023160262351600625, 0.02181595992179754, 0.0456295519877655, 0.07987666109234073], [0.03285239743346724, 0.04238700334617747, 0.010586511110761856, 0.009264262003424725, 0.04831343828189751, 0.023253474571556534, 0.009378409965910392, 0.012532313626729094, 0.013539127697606845, 0.012364340937448148, 0.014049115263945552, 0.04442633139504016, 0.011185727146706518, 0.011219031175923431, 0.012542279793466584, 0.053295799196204266, 0.013149709853661493, 0.01692274850452728, 0.014348528248331268, 0.11165965326339286, 0.02072769903152562, 0.017798762110702537, 0.01865911547997833, 0.30226948448997776, 0.0224174852436065, 0.02845558911212413, 0.04122442309936595, 0.031177238616539905], [0.06221314137977198, 0.04035407615542907, 0.03609673172714655, 0.027739999415806446, 0.03962971289399191, 0.034485248728940154, 0.02147169260349363, 0.025582777921649466, 0.031951966862763026, 0.02560538741585001, 0.021343942521297826, 0.05292094148467818, 0.04136292730503346, 0.024899527965053753, 0.01968924941961817, 0.0663307275961328, 0.04798784741120012, 0.02148479126516998, 0.016917474106208755, 0.06908433739703358, 0.04650965170852411, 0.014678668060464235, 0.010470969334562768, 0.030416689727069006, 0.025575459413846122, 0.038313383177523024, 0.020240633735770137, 0.01680661311241666, 0.0698354301535549], [0.029520797611034186, 0.03280984489985847, 0.04799069483406048, 0.016769945270912846, 0.024723340517737433, 0.0213684696120684, 0.020910800769546097, 0.01998168319337377, 0.0220123412953076, 0.05473775243140476, 0.025569555107653474, 0.025921993257765258, 0.019826799620634643, 0.0935158987872341, 0.012243423517336437, 0.015873179858335317, 0.018440729811493115, 0.06994620114906412, 0.01079927607115328, 0.025679506386212737, 0.018334722680824322, 0.08717603692161124, 0.011671357632720317, 0.032654794245515935, 0.01849269313916095, 0.026558773749769157, 0.12893536372814224, 0.01322097947674063, 0.03848326386617845, 0.01582978055715025], [0.06441903728776993, 0.041124216064522795, 0.031923888105929214, 0.02204908089179162, 0.032613640439093254, 0.02830385899084401, 0.019900928829719087, 0.021996284872840385, 0.022262544788175968, 0.021206164039790303, 0.022122130792618114, 0.02433335298462723, 0.02191152668152203, 0.025432747188107417, 0.025512402979789326, 0.026177116034691972, 0.021359398222911684, 0.029556737971948403, 0.02584079434076926, 0.025662779089392056, 0.022267417396839136, 0.04748420766010813, 0.04330734169691333, 0.023719841615770457, 0.024823570413109453, 0.027085859733277495, 0.03363256711217583, 0.03081957002552335, 0.035200346757438376, 0.05315336497671798, 0.10479728201527241], [0.026513928651264087, 0.03996917549664565, 0.01336795191617863, 0.010597158012240608, 0.04237416079809983, 0.023763557627826, 0.008221771040211401, 0.009221280920650185, 0.009150429807902939, 0.010111475668547514, 0.008101869652523458, 0.03677428507743584, 0.008289414587737038, 0.009778549749367605, 0.007703805300656185, 0.06010964273600191, 0.008879772857145123, 0.011388392216368422, 0.008067562450328726, 0.09153109834999053, 0.009388531384721307, 0.011134951236827827, 0.00956483393465031, 0.12388904673862935, 0.013818657777519864, 0.011759429344424652, 0.01545819708295023, 0.013123264623761257, 0.2816658448974558, 0.009934198979630255, 0.03318202059621369, 0.023165740486093794], [0.05527320581444954, 0.03985341981678364, 0.03235298654446862, 0.027144944126741392, 0.03843480710787998, 0.03109095833162721, 0.020638240861950884, 0.024596846921929653, 0.030455982480456594, 0.022957420402903116, 0.018587627070486307, 0.045464092954121876, 0.035968364824018925, 0.024309060897302424, 0.017190176758570944, 0.05426550707220189, 0.04065017139277534, 0.022347336288523516, 0.016219078758086015, 0.061129419503222, 0.03963798107741524, 0.017390045008918286, 0.012379769297468477, 0.030319509150308156, 0.021345550133168214, 0.02770792531639662, 0.014707599585315756, 0.010161270660708686, 0.02618361149979908, 0.030936126282389936, 0.018493118411428245, 0.016388875782210096, 0.07541896986597323], [0.028604801002755496, 0.025196027324244783, 0.04535564967265759, 0.015042571355065773, 0.0253303627331166, 0.02113174846166937, 0.018956051830727825, 0.017419019501773512, 0.02023461134175331, 0.04528755690630328, 0.024829193826920764, 0.01964395416310902, 0.016835016353966822, 0.08095601380115533, 0.014768383876332225, 0.014534612986943597, 0.01412567975359456, 0.06321386553457962, 0.010248442151915962, 0.02020355105684127, 0.012323673418761331, 0.07051399581029677, 0.008180605737939259, 0.014647010663558563, 0.011638164213219008, 0.013623073041649628, 0.08870950991726519, 0.007701713194232714, 0.013349381726738505, 0.016396629349832707, 0.15157878282899045, 0.00598529439448228, 0.03204134295994345, 0.011393709107663425], [0.055056951133384546, 0.03327171757863513, 0.026115594175049647, 0.018571004312752437, 0.02655104622484275, 0.022729516197158284, 0.018672438877486847, 0.019096251252306434, 0.0258496906875435, 0.018537624648051115, 0.022421832368904562, 0.024952902842440228, 0.024646684061357397, 0.02553588062753793, 0.02348346716593885, 0.024558776436320057, 0.022823594513823788, 0.02712895274964992, 0.022587062070070635, 0.026247820217751777, 0.022484531256485616, 0.04012478423799349, 0.03213869427137696, 0.024823181589918766, 0.02413996197086686, 0.02861705803808665, 0.035784301227839606, 0.038505589727573106, 0.02580730514791181, 0.026507453189903562, 0.03219930104710535, 0.034136049933238, 0.029385515454451692, 0.03762121631555652, 0.05888624845068611], [0.029205943891571724, 0.029347661704450134, 0.009838275561310655, 0.009602464921021443, 0.03263746331446067, 0.020433761212861026, 0.01130490670259332, 0.01184901333066446, 0.01796190273168147, 0.0131068952023176, 0.015070518945382463, 0.06729813746025508, 0.011878667712935368, 0.013500651808379328, 0.010550680451296252, 0.05451186965640294, 0.011961710634348581, 0.01073257122258376, 0.01027470208354395, 0.061364805825737605, 0.008301138166219928, 0.010733987768719751, 0.007677867560981801, 0.04777003752991944, 0.0116287070884541, 0.01008251284314948, 0.01365588950529145, 0.010466767641604669, 0.10649904538779335, 0.012668998936889938, 0.019249581298600334, 0.013833703703392337, 0.18181207897936613, 0.017838251640128023, 0.04450591937043558, 0.030842908205255964], [0.05600816870849343, 0.036486563571139594, 0.03259601368337945, 0.028881956568237235, 0.035421801357631004, 0.029029653033139688, 0.01957344704877028, 0.02314110879561195, 0.028182487350039868, 0.01905626295557975, 0.015183531576145243, 0.03328716950551948, 0.029895299789270673, 0.01824382111574043, 0.014201543582820825, 0.03616711103919022, 0.031680212001509674, 0.018071817065111042, 0.014655408172707796, 0.04355873896082935, 0.034169751826506486, 0.018336817155476928, 0.012224884985489607, 0.028070950397248034, 0.02011471784137302, 0.029285600409118238, 0.01659500376416177, 0.011930882738352758, 0.024247208727367436, 0.027916271762691375, 0.01862791748394554, 0.009699461853488571, 0.028074287616200268, 0.03520978976414255, 0.015218178003292122, 0.017318143548209427, 0.089638016242069], [0.024876340572622717, 0.02073237813294803, 0.03228543045952525, 0.012506722912544673, 0.018254871252460204, 0.01588442808394393, 0.014337218283803462, 0.013374567647804675, 0.017658386270452898, 0.033507027054220935, 0.019483623754524244, 0.015405548533093026, 0.013742646260982355, 0.06458243967090431, 0.012706480531367415, 0.011949818927808113, 0.011292717834778898, 0.04175864389687742, 0.008290162394041624, 0.018854569551775127, 0.01074442492833296, 0.04890260305697074, 0.006030236720307029, 0.009636683115558674, 0.009422886880231334, 0.010575497827085799, 0.05195444917923404, 0.007716759730369863, 0.01823787933588457, 0.01421164597163132, 0.0749133924366528, 0.009717704021195993, 0.05010304511262495, 0.020880654695473514, 0.18634696492032676, 0.0053291940051680056, 0.03213492906428976, 0.011657026972182523], [0.04951829556069409, 0.0337880145784422, 0.025647231021833656, 0.019414847222696062, 0.029095084216310834, 0.025034358940539226, 0.015535601692538998, 0.01681253876883839, 0.01800433598684106, 0.013422528761427027, 0.016342800269392874, 0.020584402965991955, 0.01422751307266618, 0.014882243804467763, 0.016707586455164423, 0.021179763987091316, 0.014002307711422815, 0.016638836904110575, 0.014843808672460376, 0.020838333613116163, 0.014711754178840087, 0.02208412515733296, 0.0214287278031274, 0.022172745951932193, 0.022618524003011103, 0.01855148020020462, 0.025031722721920672, 0.025639978213495757, 0.028539481991283023, 0.02335730841502124, 0.03304438898364873, 0.030634798729525396, 0.03139807518280172, 0.029819868476032, 0.026994829925925175, 0.027343877810664798, 0.04437798209982799, 0.04272074613050459, 0.09300914981885457], [0.014738321705615023, 0.016796524572112226, 0.005678127972004815, 0.004596057014882546, 0.02069128217272541, 0.012744805699992593, 0.005710013515116223, 0.006840817019345103, 0.007546536286077329, 0.00798847494907962, 0.0063925201572581185, 0.02864791960346581, 0.006303500412751308, 0.0065769250247910095, 0.005592139975526253, 0.02298646847274753, 0.007238450393083181, 0.008260564044618836, 0.005641225739487664, 0.02603052137252563, 0.007812171256213309, 0.008958762233139307, 0.005746863326886982, 0.027531786464090553, 0.011123063498879605, 0.013041574818298117, 0.015577985313908688, 0.011609426488244418, 0.07582147842657143, 0.016591683638387988, 0.02228036858234722, 0.014242314485823407, 0.10254995087651353, 0.022515984946287846, 0.028118587788115233, 0.022817744841459837, 0.2869745820325402, 0.025166571594421833, 0.03652673503557285, 0.01799116824909139], [0.0525085418213818, 0.035648796945815305, 0.029231744370858914, 0.026736516780216678, 0.03414634824333371, 0.02723074923421281, 0.019265327427185015, 0.02231811858094469, 0.026333108099529996, 0.01841888241157141, 0.015062320494875124, 0.0321756284610581, 0.026885030681228633, 0.017341132000439418, 0.012550600118072967, 0.03390537766576998, 0.027888059098871414, 0.016875816676121397, 0.012836882964477596, 0.04058241920599976, 0.029198232603526362, 0.017441007611477398, 0.011279184065980502, 0.03009012409598985, 0.01910840524461543, 0.025087430787301614, 0.01672853052632543, 0.011447803473598606, 0.02200611058064954, 0.022504758191420927, 0.018428358862468488, 0.009370584229085007, 0.023580455263937147, 0.022720521736298262, 0.015032168972650107, 0.008419022198377785, 0.037194158912755945, 0.025122115255822062, 0.018374625202931236, 0.015292017280035264, 0.07363298362278829], [0.02136553273648282, 0.022090043303421347, 0.025535939756691942, 0.010933642072461863, 0.018593577056058186, 0.016599077945778976, 0.012257269662757945, 0.011416775641411659, 0.013625903572152225, 0.02469046987767595, 0.01456821682581472, 0.015363684349107867, 0.011896493798297833, 0.04673759894978191, 0.01001647267189606, 0.010828529446411229, 0.009168034316706623, 0.030405419935462984, 0.008552247691452358, 0.018527540911872784, 0.009494964065700157, 0.02762511997454346, 0.005586260596654724, 0.009917022725701313, 0.009155411603429964, 0.010460353167737028, 0.045066273381454365, 0.007333697946395677, 0.024642519020658966, 0.013473455432104589, 0.0666089397094416, 0.009229875694080118, 0.025299726886564337, 0.014610875595352402, 0.13272736326790086, 0.011157920321485248, 0.02390653694229902, 0.01925646799969419, 0.1072592216551453, 0.007465498829081969, 0.05423285847098162, 0.01231716619189573]]})\n",
       "\n",
       "             }, function (err) {\n",
       "                console.log(err);\n",
       "            })"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output.primary_attributions(attr_method='ig', style=\"detailed\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html lang=\"en\">\n",
       "<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
       "<script>\n",
       "    var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
       "    // var ecco_url = 'http://localhost:8000/ecco/'\n",
       "\n",
       "    if (window.ecco === undefined) window.ecco = {}\n",
       "\n",
       "    requirejs.config({\n",
       "        urlArgs: \"bust=\" + (new Date()).getTime(),\n",
       "        nodeRequire: require,\n",
       "        paths: {\n",
       "            d3: \"https://d3js.org/d3.v5.min\",\n",
       "            \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
       "            jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
       "            // oldEcco: ecco_url + 'ecco',\n",
       "            ecco: ecco_url + 'js/0.0.4/ecco-bundle.min',\n",
       "            xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
       "        }\n",
       "    });\n",
       "    requirejs(['d3'],\n",
       "        function (d3) {\n",
       "            d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
       "        })\n",
       "\n",
       "    console.log('Ecco initialize.')\n",
       "</script>\n",
       "\n",
       "<head>\n",
       "    <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
       "</head>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    // console.log('defining basic')\n",
       "    define('basic', ['d3'],\n",
       "        function (d3) {\n",
       "            return {\n",
       "                init: function (viz_id = null) {\n",
       "\n",
       "                    // console.log('basic init')\n",
       "                    if (viz_id == null){\n",
       "                        viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
       "                    }\n",
       "                    const div = d3.select('#basic').attr('id', viz_id),\n",
       "                        div_parent = d3.select('#' + viz_id).node().parentNode\n",
       "\n",
       "                    // Link to CSS file\n",
       "                    d3.select(div_parent).insert('link')\n",
       "                        .attr('rel', 'stylesheet')\n",
       "                        .attr('type', 'text/css')\n",
       "                        .attr('href', ecco_url + 'html/styles.css')\n",
       "\n",
       "                    return viz_id\n",
       "                }\n",
       "            }\n",
       "        }, function (err) {console.log(err);}\n",
       "    )\n",
       "    // console.log('after defining basic')\n",
       "\n",
       "</script>\n",
       "<div id=\"basic\"></div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "             requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                const viz_id = basic.init()\n",
       "                // ecco.interactiveTokens(viz_id, {})\n",
       "                window.ecco[viz_id] = new ecco.MinimalHighlighter({\n",
       "                parentDiv: viz_id,\n",
       "                data: {'tokens': [{'token': 'The', 'token_id': 464, 'type': 'input', 'value': '0.03995489', 'position': 0}, {'token': ' countries', 'token_id': 2678, 'type': 'input', 'value': '0.046092637', 'position': 1}, {'token': ' of', 'token_id': 286, 'type': 'input', 'value': '0.012341926', 'position': 2}, {'token': ' the', 'token_id': 262, 'type': 'input', 'value': '0.009616704', 'position': 3}, {'token': ' European', 'token_id': 3427, 'type': 'input', 'value': '0.06653631', 'position': 4}, {'token': ' Union', 'token_id': 4479, 'type': 'input', 'value': '0.029602217', 'position': 5}, {'token': ' are', 'token_id': 389, 'type': 'input', 'value': '0.01294323', 'position': 6}, {'token': ':', 'token_id': 25, 'type': 'input', 'value': '0.019124448', 'position': 7}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.025561146', 'position': 8}, {'token': '1', 'token_id': 16, 'type': 'input', 'value': '0.021054178', 'position': 9}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.017810594', 'position': 10}, {'token': ' Austria', 'token_id': 17322, 'type': 'input', 'value': '0.08213705', 'position': 11}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.03277671', 'position': 12}, {'token': '2', 'token_id': 17, 'type': 'input', 'value': '0.023196338', 'position': 13}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.01580996', 'position': 14}, {'token': ' Belgium', 'token_id': 15664, 'type': 'input', 'value': '0.13048644', 'position': 15}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.014057648', 'position': 16}, {'token': '3', 'token_id': 18, 'type': 'input', 'value': '0.013611077', 'position': 17}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.018001992', 'position': 18}, {'token': ' Bulgaria', 'token_id': 27902, 'type': 'input', 'value': '0.28011447', 'position': 19}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.024230529', 'position': 20}, {'token': '4', 'token_id': 19, 'type': 'input', 'value': '0.03510821', 'position': 21}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.029831212', 'position': 22}, {'token': ' Czech', 'token_id': 16639, 'type': 'output', 'value': '0', 'position': 23}, {'token': ' Republic', 'token_id': 2066, 'type': 'output', 'value': '0', 'position': 24}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 25}, {'token': '5', 'token_id': 20, 'type': 'output', 'value': '0', 'position': 26}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 27}, {'token': ' Denmark', 'token_id': 16490, 'type': 'output', 'value': '0', 'position': 28}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 29}, {'token': '6', 'token_id': 21, 'type': 'output', 'value': '0', 'position': 30}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 31}, {'token': ' Finland', 'token_id': 17837, 'type': 'output', 'value': '0', 'position': 32}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 33}, {'token': '7', 'token_id': 22, 'type': 'output', 'value': '0', 'position': 34}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 35}, {'token': ' Malta', 'token_id': 35206, 'type': 'output', 'value': '0', 'position': 36}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 37}, {'token': '8', 'token_id': 23, 'type': 'output', 'value': '0', 'position': 38}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 39}, {'token': ' Portugal', 'token_id': 19101, 'type': 'output', 'value': '0', 'position': 40}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 41}, {'token': '9', 'token_id': 24, 'type': 'output', 'value': '0', 'position': 42}], 'attributions': [[0.03995488956570625, 0.04609263688325882, 0.012341925874352455, 0.009616703726351261, 0.0665363073348999, 0.02960221655666828, 0.012943229638040066, 0.01912444829940796, 0.025561146438121796, 0.021054178476333618, 0.01781059429049492, 0.08213704824447632, 0.03277670964598656, 0.02319633774459362, 0.015809960663318634, 0.13048644363880157, 0.014057648368179798, 0.013611077331006527, 0.018001992255449295, 0.28011447191238403, 0.024230528622865677, 0.035108208656311035, 0.029831212013959885], [0.04766524210572243, 0.054031964391469955, 0.013689798302948475, 0.010406037792563438, 0.040570877492427826, 0.029373163357377052, 0.018996648490428925, 0.018641114234924316, 0.023699987679719925, 0.02272162213921547, 0.013095864094793797, 0.0536995455622673, 0.024743007495999336, 0.020329376682639122, 0.010667388327419758, 0.04598061367869377, 0.027511991560459137, 0.022379711270332336, 0.013304481282830238, 0.06164801865816116, 0.02892594411969185, 0.03398517519235611, 0.03193006291985512, 0.33200231194496155], [0.04933314770460129, 0.05939779803156853, 0.01576872542500496, 0.01352313719689846, 0.04100833088159561, 0.02942351996898651, 0.029910288751125336, 0.03760402649641037, 0.03159676119685173, 0.03782665356993675, 0.018696805462241173, 0.07666239887475967, 0.02331661805510521, 0.02828473225235939, 0.013677000999450684, 0.04823830723762512, 0.02501366101205349, 0.02349674701690674, 0.013978519476950169, 0.05449382960796356, 0.037681303918361664, 0.029941372573375702, 0.018302395939826965, 0.10456874221563339, 0.13825520873069763], [0.0379042848944664, 0.052158065140247345, 0.012546258978545666, 0.009059286676347256, 0.02816160023212433, 0.022057324647903442, 0.026213545352220535, 0.02888542227447033, 0.033397126942873, 0.04166606068611145, 0.017678165808320045, 0.04170360788702965, 0.0253955889493227, 0.04022147133946419, 0.013843380846083164, 0.029899798333644867, 0.034191180020570755, 0.046694956719875336, 0.018455518409609795, 0.03993447870016098, 0.04202520474791527, 0.19402241706848145, 0.031817346811294556, 0.04141046106815338, 0.027624117210507393, 0.06303336471319199], [0.05423485115170479, 0.04590393975377083, 0.014628839679062366, 0.012220756150782108, 0.032429929822683334, 0.022446900606155396, 0.022936327382922173, 0.03759552910923958, 0.03952156379818916, 0.06793771684169769, 0.041478920727968216, 0.05078713595867157, 0.031567540019750595, 0.03714843839406967, 0.03836941346526146, 0.029923152178525925, 0.02889394201338291, 0.032740190625190735, 0.03678199648857117, 0.030858512967824936, 0.024683484807610512, 0.03822103887796402, 0.0380372628569603, 0.029742322862148285, 0.018610011786222458, 0.06069214269518852, 0.08160825073719025], [0.040498148649930954, 0.0457313172519207, 0.011494407430291176, 0.010272146202623844, 0.06693708896636963, 0.024216819554567337, 0.010046113282442093, 0.013145335018634796, 0.019024120643734932, 0.017308823764324188, 0.01452280767261982, 0.0809684619307518, 0.01416623406112194, 0.0168674997985363, 0.014848168008029461, 0.06063980236649513, 0.012325943447649479, 0.017226826399564743, 0.013339817523956299, 0.09769879281520844, 0.016876904293894768, 0.01849001832306385, 0.014023507945239544, 0.2185320109128952, 0.015701783820986748, 0.03154094144701958, 0.03759264200925827, 0.045963454991579056], [0.04891597107052803, 0.045093175023794174, 0.014019765891134739, 0.010866718366742134, 0.036934465169906616, 0.02476893737912178, 0.02839737758040428, 0.03399715945124626, 0.025825923308730125, 0.028494155034422874, 0.017022743821144104, 0.08478281646966934, 0.017467953264713287, 0.0205832589417696, 0.01287771575152874, 0.06523995101451874, 0.015341371297836304, 0.01855940744280815, 0.01146106980741024, 0.06345884501934052, 0.01737932302057743, 0.02265743538737297, 0.013844961300492287, 0.037733834236860275, 0.022143052890896797, 0.033505652099847794, 0.050610560923814774, 0.028276996687054634, 0.1497393399477005], [0.03655396029353142, 0.051419686526060104, 0.012846735306084156, 0.009418736211955547, 0.02360384911298752, 0.01958317682147026, 0.021939024329185486, 0.0317826047539711, 0.027487589046359062, 0.037492040544748306, 0.01750839129090309, 0.04019453004002571, 0.027298999950289726, 0.03193531930446625, 0.011211165226995945, 0.024432582780718803, 0.022353222593665123, 0.0287004504352808, 0.017808107659220695, 0.03129691258072853, 0.02895544469356537, 0.04638059437274933, 0.020582325756549835, 0.03656988590955734, 0.02058773674070835, 0.048150841146707535, 0.13804155588150024, 0.03325476124882698, 0.05689690634608269, 0.04571277275681496], [0.050925951451063156, 0.040266554802656174, 0.013551289215683937, 0.012702982872724533, 0.028943859040737152, 0.019966868683695793, 0.022478239610791206, 0.03303799778223038, 0.0350581631064415, 0.060456544160842896, 0.03222519904375076, 0.04529115930199623, 0.026951102539896965, 0.030741699039936066, 0.03342122584581375, 0.03106698766350746, 0.02424750104546547, 0.030109327286481857, 0.02666904591023922, 0.030451694503426552, 0.021804379299283028, 0.027113087475299835, 0.02797495201230049, 0.020315848290920258, 0.013060478493571281, 0.026175744831562042, 0.03455895557999611, 0.032865773886442184, 0.028912445530295372, 0.060079529881477356, 0.07857543230056763], [0.03446061909198761, 0.043323490768671036, 0.009486950933933258, 0.00951372366398573, 0.0661461278796196, 0.030791981145739555, 0.00877789780497551, 0.011723177507519722, 0.011900457553565502, 0.012539255432784557, 0.0073905522003769875, 0.03717310354113579, 0.00949886068701744, 0.009504692628979683, 0.0080531882122159, 0.03106309100985527, 0.009043015539646149, 0.01025361754000187, 0.007118184585124254, 0.043711233884096146, 0.008959544822573662, 0.012142273597419262, 0.008418477140367031, 0.08798317611217499, 0.015441983938217163, 0.012077951803803444, 0.01454404927790165, 0.015016118995845318, 0.33437445759773254, 0.01328553818166256, 0.03604565188288689, 0.030237622559070587], [0.04601547122001648, 0.04111082851886749, 0.01361287385225296, 0.011997934430837631, 0.03387408331036568, 0.02278107777237892, 0.025379592552781105, 0.03243429958820343, 0.025883663445711136, 0.028234250843524933, 0.016724949702620506, 0.07658276706933975, 0.018667418509721756, 0.021937474608421326, 0.012433012947440147, 0.058636002242565155, 0.01469478476792574, 0.014767221175134182, 0.009734777733683586, 0.05350314453244209, 0.014966540038585663, 0.015413912013173103, 0.009351016953587532, 0.03590640798211098, 0.01696447655558586, 0.015884337946772575, 0.02080153301358223, 0.010841524228453636, 0.03866633400321007, 0.027825379744172096, 0.04537789151072502, 0.017789075151085854, 0.15120601654052734], [0.03475948050618172, 0.046625759452581406, 0.010724267922341824, 0.007855958305299282, 0.02523389831185341, 0.01927381008863449, 0.01909908466041088, 0.024959122762084007, 0.0327962264418602, 0.031171075999736786, 0.01404049713164568, 0.034555789083242416, 0.023969026282429695, 0.022172115743160248, 0.008904794231057167, 0.024030238389968872, 0.018729746341705322, 0.023668646812438965, 0.011305194348096848, 0.027438180521130562, 0.018609240651130676, 0.028607545420527458, 0.016995130106806755, 0.02276478335261345, 0.01660630851984024, 0.023422393947839737, 0.04764029011130333, 0.019231706857681274, 0.02978779561817646, 0.037359531968832016, 0.1565769761800766, 0.02437165565788746, 0.053502220660448074, 0.04321150481700897], [0.04917958378791809, 0.03769008815288544, 0.01229115016758442, 0.011778268031775951, 0.02640899084508419, 0.018296169117093086, 0.019935661926865578, 0.028513919562101364, 0.031483277678489685, 0.05188361927866936, 0.026720166206359863, 0.04287606105208397, 0.024299640208482742, 0.02656923234462738, 0.028281569480895996, 0.03145696222782135, 0.019839931279420853, 0.023569516837596893, 0.024090655148029327, 0.03124437853693962, 0.018391776829957962, 0.020261690020561218, 0.02235454134643078, 0.020692765712738037, 0.011421306990087032, 0.022832686081528664, 0.019657116383314133, 0.02441449649631977, 0.018030591309070587, 0.026139259338378906, 0.035458896309137344, 0.032404825091362, 0.027829641476273537, 0.058779049664735794, 0.07492249459028244], [0.02604084275662899, 0.027450233697891235, 0.007446587551385164, 0.0067648449912667274, 0.03380385786294937, 0.016157273203134537, 0.00807882659137249, 0.01061614602804184, 0.017333775758743286, 0.013983059674501419, 0.013055741786956787, 0.06111537665128708, 0.011982838623225689, 0.010929504409432411, 0.00815814733505249, 0.037036601454019547, 0.011302093043923378, 0.011431165039539337, 0.008538148365914822, 0.0501263365149498, 0.00962772686034441, 0.009181504137814045, 0.007155125495046377, 0.042527761310338974, 0.011571275070309639, 0.010891682468354702, 0.014046531170606613, 0.01180928573012352, 0.1390366107225418, 0.01523364894092083, 0.017496589571237564, 0.011824539862573147, 0.233847975730896, 0.012849796563386917, 0.032972756773233414, 0.028575703501701355], [0.04552276059985161, 0.04012593999505043, 0.013129412196576595, 0.010854296386241913, 0.033715780824422836, 0.022302445024251938, 0.027141045778989792, 0.03193167224526405, 0.02651238441467285, 0.025221053510904312, 0.014694447629153728, 0.06420750170946121, 0.018299488350749016, 0.02012437768280506, 0.010229934006929398, 0.052341435104608536, 0.012383900582790375, 0.013244682922959328, 0.008385367691516876, 0.04778890684247017, 0.012570641934871674, 0.011864581145346165, 0.007808326277881861, 0.031416114419698715, 0.014397735707461834, 0.011023190803825855, 0.014902434311807156, 0.009293514303863049, 0.03445664420723915, 0.014285295270383358, 0.014834299683570862, 0.011464548297226429, 0.034686364233493805, 0.024307280778884888, 0.03587228059768677, 0.015705890953540802, 0.16295407712459564], [0.03060147538781166, 0.040853627026081085, 0.009864137507975101, 0.007987920194864273, 0.021008629351854324, 0.01673799566924572, 0.01772644743323326, 0.023702554404735565, 0.029614241793751717, 0.02852759137749672, 0.01456192135810852, 0.027544450014829636, 0.018199684098362923, 0.021254926919937134, 0.008937789127230644, 0.019770439714193344, 0.014612373895943165, 0.025392144918441772, 0.008553288877010345, 0.02672257274389267, 0.014381897635757923, 0.028525186702609062, 0.009463205002248287, 0.018345575779676437, 0.013412349857389927, 0.01755409687757492, 0.028795653954148293, 0.016135456040501595, 0.02969137206673622, 0.023691346868872643, 0.04504988342523575, 0.020145658403635025, 0.02947578951716423, 0.040626417845487595, 0.1575569361448288, 0.015421013347804546, 0.0390767902135849, 0.04047716408967972], [0.04692164808511734, 0.03763464465737343, 0.011839073151350021, 0.011346008628606796, 0.02508770301938057, 0.01782461628317833, 0.018559256568551064, 0.02633930742740631, 0.029734810814261436, 0.04938551038503647, 0.024777403101325035, 0.03704630583524704, 0.02066807635128498, 0.022683512419462204, 0.024976380169391632, 0.027973396703600883, 0.018214505165815353, 0.021603349596261978, 0.018086783587932587, 0.028482841327786446, 0.015922142192721367, 0.0178762786090374, 0.017423776909708977, 0.020784838125109673, 0.01144589763134718, 0.01787237636744976, 0.01824517920613289, 0.017843537032604218, 0.01672028750181198, 0.017644546926021576, 0.024019908159971237, 0.02127358876168728, 0.01870734430849552, 0.018010511994361877, 0.029355527833104134, 0.025406936183571815, 0.03354170545935631, 0.05899152532219887, 0.07972896844148636], [0.018145807087421417, 0.02191121317446232, 0.006010712124407291, 0.0050897905603051186, 0.022817181423306465, 0.01219047512859106, 0.007013220805674791, 0.007992517203092575, 0.009156091138720512, 0.010565056465566158, 0.008335995487868786, 0.040094584226608276, 0.006840541027486324, 0.007624827325344086, 0.0068575721234083176, 0.028625095263123512, 0.006999027915298939, 0.008275159634649754, 0.007032744586467743, 0.03072705864906311, 0.008638461120426655, 0.009576991200447083, 0.0063989851623773575, 0.025592271238565445, 0.010509785264730453, 0.014061706140637398, 0.01588624343276024, 0.010652532801032066, 0.08823447674512863, 0.013198206201195717, 0.020953761413693428, 0.012509376741945744, 0.10182365030050278, 0.019963780418038368, 0.027521517127752304, 0.019861042499542236, 0.24059930443763733, 0.027166375890374184, 0.03158830106258392, 0.022958552464842796], [0.042368147522211075, 0.03742741420865059, 0.011721329763531685, 0.009725152514874935, 0.029497893527150154, 0.019850213080644608, 0.022893356159329414, 0.027950910851359367, 0.023978354409337044, 0.02561163529753685, 0.013361128978431225, 0.06270426511764526, 0.016536472365260124, 0.020847728475928307, 0.009991137310862541, 0.04908992722630501, 0.0118551729246974, 0.01350922230631113, 0.008686461485922337, 0.049634531140327454, 0.01141072902828455, 0.011430052109062672, 0.007494030985981226, 0.03536127135157585, 0.01605093851685524, 0.00999829825013876, 0.013625686056911945, 0.00861162319779396, 0.025758221745491028, 0.012558260932564735, 0.013093535788357258, 0.009043917059898376, 0.030319925397634506, 0.014312352985143661, 0.015327982604503632, 0.008904405869543552, 0.03060459904372692, 0.021852955222129822, 0.04441773146390915, 0.01588016003370285, 0.13670283555984497], [0.026546742767095566, 0.03074135072529316, 0.0076278322376310825, 0.005896252114325762, 0.01703653112053871, 0.0129587696865201, 0.014452856034040451, 0.020470689982175827, 0.0216459222137928, 0.022817041724920273, 0.010705389082431793, 0.02301623299717903, 0.014453339390456676, 0.016541382297873497, 0.006982330698519945, 0.016962608322501183, 0.01153047475963831, 0.017457373440265656, 0.006997311022132635, 0.023362092673778534, 0.01234087161719799, 0.018261225894093513, 0.007555398158729076, 0.01582743227481842, 0.012104104273021221, 0.013575062155723572, 0.01888303831219673, 0.010290802456438541, 0.024392826482653618, 0.018442358821630478, 0.024473246186971664, 0.02112126722931862, 0.021562393754720688, 0.025122210383415222, 0.06806859374046326, 0.020466849207878113, 0.037530262023210526, 0.027722099795937538, 0.15318669378757477, 0.02737254835665226, 0.05517629161477089, 0.038321930915117264]]},\n",
       "                preset: 'viridis'\n",
       "             })\n",
       "\n",
       "             window.ecco[viz_id].init();\n",
       "             window.ecco[viz_id].selectFirstToken();\n",
       "\n",
       "             }, function (err) {\n",
       "                console.log(err);\n",
       "            })"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output.primary_attributions(attr_method='grad_x_input')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html lang=\"en\">\n",
       "<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
       "<script>\n",
       "    var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
       "    // var ecco_url = 'http://localhost:8000/ecco/'\n",
       "\n",
       "    if (window.ecco === undefined) window.ecco = {}\n",
       "\n",
       "    requirejs.config({\n",
       "        urlArgs: \"bust=\" + (new Date()).getTime(),\n",
       "        nodeRequire: require,\n",
       "        paths: {\n",
       "            d3: \"https://d3js.org/d3.v5.min\",\n",
       "            \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
       "            jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
       "            // oldEcco: ecco_url + 'ecco',\n",
       "            ecco: ecco_url + 'js/0.0.4/ecco-bundle.min',\n",
       "            xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
       "        }\n",
       "    });\n",
       "    requirejs(['d3'],\n",
       "        function (d3) {\n",
       "            d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
       "        })\n",
       "\n",
       "    console.log('Ecco initialize.')\n",
       "</script>\n",
       "\n",
       "<head>\n",
       "    <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
       "</head>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    // console.log('defining basic')\n",
       "    define('basic', ['d3'],\n",
       "        function (d3) {\n",
       "            return {\n",
       "                init: function (viz_id = null) {\n",
       "\n",
       "                    // console.log('basic init')\n",
       "                    if (viz_id == null){\n",
       "                        viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
       "                    }\n",
       "                    const div = d3.select('#basic').attr('id', viz_id),\n",
       "                        div_parent = d3.select('#' + viz_id).node().parentNode\n",
       "\n",
       "                    // Link to CSS file\n",
       "                    d3.select(div_parent).insert('link')\n",
       "                        .attr('rel', 'stylesheet')\n",
       "                        .attr('type', 'text/css')\n",
       "                        .attr('href', ecco_url + 'html/styles.css')\n",
       "\n",
       "                    return viz_id\n",
       "                }\n",
       "            }\n",
       "        }, function (err) {console.log(err);}\n",
       "    )\n",
       "    // console.log('after defining basic')\n",
       "\n",
       "</script>\n",
       "<div id=\"basic\"></div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "             requirejs(['basic', 'ecco'], function(basic, ecco){\n",
       "                const viz_id = basic.init()\n",
       "                window.ecco[viz_id] = ecco.interactiveTokens(viz_id, {'tokens': [{'token': 'The', 'token_id': 464, 'type': 'input', 'value': '0.03995489', 'position': 0}, {'token': ' countries', 'token_id': 2678, 'type': 'input', 'value': '0.046092637', 'position': 1}, {'token': ' of', 'token_id': 286, 'type': 'input', 'value': '0.012341926', 'position': 2}, {'token': ' the', 'token_id': 262, 'type': 'input', 'value': '0.009616704', 'position': 3}, {'token': ' European', 'token_id': 3427, 'type': 'input', 'value': '0.06653631', 'position': 4}, {'token': ' Union', 'token_id': 4479, 'type': 'input', 'value': '0.029602217', 'position': 5}, {'token': ' are', 'token_id': 389, 'type': 'input', 'value': '0.01294323', 'position': 6}, {'token': ':', 'token_id': 25, 'type': 'input', 'value': '0.019124448', 'position': 7}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.025561146', 'position': 8}, {'token': '1', 'token_id': 16, 'type': 'input', 'value': '0.021054178', 'position': 9}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.017810594', 'position': 10}, {'token': ' Austria', 'token_id': 17322, 'type': 'input', 'value': '0.08213705', 'position': 11}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.03277671', 'position': 12}, {'token': '2', 'token_id': 17, 'type': 'input', 'value': '0.023196338', 'position': 13}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.01580996', 'position': 14}, {'token': ' Belgium', 'token_id': 15664, 'type': 'input', 'value': '0.13048644', 'position': 15}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.014057648', 'position': 16}, {'token': '3', 'token_id': 18, 'type': 'input', 'value': '0.013611077', 'position': 17}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.018001992', 'position': 18}, {'token': ' Bulgaria', 'token_id': 27902, 'type': 'input', 'value': '0.28011447', 'position': 19}, {'token': '\\n', 'token_id': 198, 'type': 'input', 'value': '0.024230529', 'position': 20}, {'token': '4', 'token_id': 19, 'type': 'input', 'value': '0.03510821', 'position': 21}, {'token': '.', 'token_id': 13, 'type': 'input', 'value': '0.029831212', 'position': 22}, {'token': ' Czech', 'token_id': 16639, 'type': 'output', 'value': '0', 'position': 23}, {'token': ' Republic', 'token_id': 2066, 'type': 'output', 'value': '0', 'position': 24}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 25}, {'token': '5', 'token_id': 20, 'type': 'output', 'value': '0', 'position': 26}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 27}, {'token': ' Denmark', 'token_id': 16490, 'type': 'output', 'value': '0', 'position': 28}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 29}, {'token': '6', 'token_id': 21, 'type': 'output', 'value': '0', 'position': 30}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 31}, {'token': ' Finland', 'token_id': 17837, 'type': 'output', 'value': '0', 'position': 32}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 33}, {'token': '7', 'token_id': 22, 'type': 'output', 'value': '0', 'position': 34}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 35}, {'token': ' Malta', 'token_id': 35206, 'type': 'output', 'value': '0', 'position': 36}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 37}, {'token': '8', 'token_id': 23, 'type': 'output', 'value': '0', 'position': 38}, {'token': '.', 'token_id': 13, 'type': 'output', 'value': '0', 'position': 39}, {'token': ' Portugal', 'token_id': 19101, 'type': 'output', 'value': '0', 'position': 40}, {'token': '\\n', 'token_id': 198, 'type': 'output', 'value': '0', 'position': 41}, {'token': '9', 'token_id': 24, 'type': 'output', 'value': '0', 'position': 42}], 'attributions': [[0.03995488956570625, 0.04609263688325882, 0.012341925874352455, 0.009616703726351261, 0.0665363073348999, 0.02960221655666828, 0.012943229638040066, 0.01912444829940796, 0.025561146438121796, 0.021054178476333618, 0.01781059429049492, 0.08213704824447632, 0.03277670964598656, 0.02319633774459362, 0.015809960663318634, 0.13048644363880157, 0.014057648368179798, 0.013611077331006527, 0.018001992255449295, 0.28011447191238403, 0.024230528622865677, 0.035108208656311035, 0.029831212013959885], [0.04766524210572243, 0.054031964391469955, 0.013689798302948475, 0.010406037792563438, 0.040570877492427826, 0.029373163357377052, 0.018996648490428925, 0.018641114234924316, 0.023699987679719925, 0.02272162213921547, 0.013095864094793797, 0.0536995455622673, 0.024743007495999336, 0.020329376682639122, 0.010667388327419758, 0.04598061367869377, 0.027511991560459137, 0.022379711270332336, 0.013304481282830238, 0.06164801865816116, 0.02892594411969185, 0.03398517519235611, 0.03193006291985512, 0.33200231194496155], [0.04933314770460129, 0.05939779803156853, 0.01576872542500496, 0.01352313719689846, 0.04100833088159561, 0.02942351996898651, 0.029910288751125336, 0.03760402649641037, 0.03159676119685173, 0.03782665356993675, 0.018696805462241173, 0.07666239887475967, 0.02331661805510521, 0.02828473225235939, 0.013677000999450684, 0.04823830723762512, 0.02501366101205349, 0.02349674701690674, 0.013978519476950169, 0.05449382960796356, 0.037681303918361664, 0.029941372573375702, 0.018302395939826965, 0.10456874221563339, 0.13825520873069763], [0.0379042848944664, 0.052158065140247345, 0.012546258978545666, 0.009059286676347256, 0.02816160023212433, 0.022057324647903442, 0.026213545352220535, 0.02888542227447033, 0.033397126942873, 0.04166606068611145, 0.017678165808320045, 0.04170360788702965, 0.0253955889493227, 0.04022147133946419, 0.013843380846083164, 0.029899798333644867, 0.034191180020570755, 0.046694956719875336, 0.018455518409609795, 0.03993447870016098, 0.04202520474791527, 0.19402241706848145, 0.031817346811294556, 0.04141046106815338, 0.027624117210507393, 0.06303336471319199], [0.05423485115170479, 0.04590393975377083, 0.014628839679062366, 0.012220756150782108, 0.032429929822683334, 0.022446900606155396, 0.022936327382922173, 0.03759552910923958, 0.03952156379818916, 0.06793771684169769, 0.041478920727968216, 0.05078713595867157, 0.031567540019750595, 0.03714843839406967, 0.03836941346526146, 0.029923152178525925, 0.02889394201338291, 0.032740190625190735, 0.03678199648857117, 0.030858512967824936, 0.024683484807610512, 0.03822103887796402, 0.0380372628569603, 0.029742322862148285, 0.018610011786222458, 0.06069214269518852, 0.08160825073719025], [0.040498148649930954, 0.0457313172519207, 0.011494407430291176, 0.010272146202623844, 0.06693708896636963, 0.024216819554567337, 0.010046113282442093, 0.013145335018634796, 0.019024120643734932, 0.017308823764324188, 0.01452280767261982, 0.0809684619307518, 0.01416623406112194, 0.0168674997985363, 0.014848168008029461, 0.06063980236649513, 0.012325943447649479, 0.017226826399564743, 0.013339817523956299, 0.09769879281520844, 0.016876904293894768, 0.01849001832306385, 0.014023507945239544, 0.2185320109128952, 0.015701783820986748, 0.03154094144701958, 0.03759264200925827, 0.045963454991579056], [0.04891597107052803, 0.045093175023794174, 0.014019765891134739, 0.010866718366742134, 0.036934465169906616, 0.02476893737912178, 0.02839737758040428, 0.03399715945124626, 0.025825923308730125, 0.028494155034422874, 0.017022743821144104, 0.08478281646966934, 0.017467953264713287, 0.0205832589417696, 0.01287771575152874, 0.06523995101451874, 0.015341371297836304, 0.01855940744280815, 0.01146106980741024, 0.06345884501934052, 0.01737932302057743, 0.02265743538737297, 0.013844961300492287, 0.037733834236860275, 0.022143052890896797, 0.033505652099847794, 0.050610560923814774, 0.028276996687054634, 0.1497393399477005], [0.03655396029353142, 0.051419686526060104, 0.012846735306084156, 0.009418736211955547, 0.02360384911298752, 0.01958317682147026, 0.021939024329185486, 0.0317826047539711, 0.027487589046359062, 0.037492040544748306, 0.01750839129090309, 0.04019453004002571, 0.027298999950289726, 0.03193531930446625, 0.011211165226995945, 0.024432582780718803, 0.022353222593665123, 0.0287004504352808, 0.017808107659220695, 0.03129691258072853, 0.02895544469356537, 0.04638059437274933, 0.020582325756549835, 0.03656988590955734, 0.02058773674070835, 0.048150841146707535, 0.13804155588150024, 0.03325476124882698, 0.05689690634608269, 0.04571277275681496], [0.050925951451063156, 0.040266554802656174, 0.013551289215683937, 0.012702982872724533, 0.028943859040737152, 0.019966868683695793, 0.022478239610791206, 0.03303799778223038, 0.0350581631064415, 0.060456544160842896, 0.03222519904375076, 0.04529115930199623, 0.026951102539896965, 0.030741699039936066, 0.03342122584581375, 0.03106698766350746, 0.02424750104546547, 0.030109327286481857, 0.02666904591023922, 0.030451694503426552, 0.021804379299283028, 0.027113087475299835, 0.02797495201230049, 0.020315848290920258, 0.013060478493571281, 0.026175744831562042, 0.03455895557999611, 0.032865773886442184, 0.028912445530295372, 0.060079529881477356, 0.07857543230056763], [0.03446061909198761, 0.043323490768671036, 0.009486950933933258, 0.00951372366398573, 0.0661461278796196, 0.030791981145739555, 0.00877789780497551, 0.011723177507519722, 0.011900457553565502, 0.012539255432784557, 0.0073905522003769875, 0.03717310354113579, 0.00949886068701744, 0.009504692628979683, 0.0080531882122159, 0.03106309100985527, 0.009043015539646149, 0.01025361754000187, 0.007118184585124254, 0.043711233884096146, 0.008959544822573662, 0.012142273597419262, 0.008418477140367031, 0.08798317611217499, 0.015441983938217163, 0.012077951803803444, 0.01454404927790165, 0.015016118995845318, 0.33437445759773254, 0.01328553818166256, 0.03604565188288689, 0.030237622559070587], [0.04601547122001648, 0.04111082851886749, 0.01361287385225296, 0.011997934430837631, 0.03387408331036568, 0.02278107777237892, 0.025379592552781105, 0.03243429958820343, 0.025883663445711136, 0.028234250843524933, 0.016724949702620506, 0.07658276706933975, 0.018667418509721756, 0.021937474608421326, 0.012433012947440147, 0.058636002242565155, 0.01469478476792574, 0.014767221175134182, 0.009734777733683586, 0.05350314453244209, 0.014966540038585663, 0.015413912013173103, 0.009351016953587532, 0.03590640798211098, 0.01696447655558586, 0.015884337946772575, 0.02080153301358223, 0.010841524228453636, 0.03866633400321007, 0.027825379744172096, 0.04537789151072502, 0.017789075151085854, 0.15120601654052734], [0.03475948050618172, 0.046625759452581406, 0.010724267922341824, 0.007855958305299282, 0.02523389831185341, 0.01927381008863449, 0.01909908466041088, 0.024959122762084007, 0.0327962264418602, 0.031171075999736786, 0.01404049713164568, 0.034555789083242416, 0.023969026282429695, 0.022172115743160248, 0.008904794231057167, 0.024030238389968872, 0.018729746341705322, 0.023668646812438965, 0.011305194348096848, 0.027438180521130562, 0.018609240651130676, 0.028607545420527458, 0.016995130106806755, 0.02276478335261345, 0.01660630851984024, 0.023422393947839737, 0.04764029011130333, 0.019231706857681274, 0.02978779561817646, 0.037359531968832016, 0.1565769761800766, 0.02437165565788746, 0.053502220660448074, 0.04321150481700897], [0.04917958378791809, 0.03769008815288544, 0.01229115016758442, 0.011778268031775951, 0.02640899084508419, 0.018296169117093086, 0.019935661926865578, 0.028513919562101364, 0.031483277678489685, 0.05188361927866936, 0.026720166206359863, 0.04287606105208397, 0.024299640208482742, 0.02656923234462738, 0.028281569480895996, 0.03145696222782135, 0.019839931279420853, 0.023569516837596893, 0.024090655148029327, 0.03124437853693962, 0.018391776829957962, 0.020261690020561218, 0.02235454134643078, 0.020692765712738037, 0.011421306990087032, 0.022832686081528664, 0.019657116383314133, 0.02441449649631977, 0.018030591309070587, 0.026139259338378906, 0.035458896309137344, 0.032404825091362, 0.027829641476273537, 0.058779049664735794, 0.07492249459028244], [0.02604084275662899, 0.027450233697891235, 0.007446587551385164, 0.0067648449912667274, 0.03380385786294937, 0.016157273203134537, 0.00807882659137249, 0.01061614602804184, 0.017333775758743286, 0.013983059674501419, 0.013055741786956787, 0.06111537665128708, 0.011982838623225689, 0.010929504409432411, 0.00815814733505249, 0.037036601454019547, 0.011302093043923378, 0.011431165039539337, 0.008538148365914822, 0.0501263365149498, 0.00962772686034441, 0.009181504137814045, 0.007155125495046377, 0.042527761310338974, 0.011571275070309639, 0.010891682468354702, 0.014046531170606613, 0.01180928573012352, 0.1390366107225418, 0.01523364894092083, 0.017496589571237564, 0.011824539862573147, 0.233847975730896, 0.012849796563386917, 0.032972756773233414, 0.028575703501701355], [0.04552276059985161, 0.04012593999505043, 0.013129412196576595, 0.010854296386241913, 0.033715780824422836, 0.022302445024251938, 0.027141045778989792, 0.03193167224526405, 0.02651238441467285, 0.025221053510904312, 0.014694447629153728, 0.06420750170946121, 0.018299488350749016, 0.02012437768280506, 0.010229934006929398, 0.052341435104608536, 0.012383900582790375, 0.013244682922959328, 0.008385367691516876, 0.04778890684247017, 0.012570641934871674, 0.011864581145346165, 0.007808326277881861, 0.031416114419698715, 0.014397735707461834, 0.011023190803825855, 0.014902434311807156, 0.009293514303863049, 0.03445664420723915, 0.014285295270383358, 0.014834299683570862, 0.011464548297226429, 0.034686364233493805, 0.024307280778884888, 0.03587228059768677, 0.015705890953540802, 0.16295407712459564], [0.03060147538781166, 0.040853627026081085, 0.009864137507975101, 0.007987920194864273, 0.021008629351854324, 0.01673799566924572, 0.01772644743323326, 0.023702554404735565, 0.029614241793751717, 0.02852759137749672, 0.01456192135810852, 0.027544450014829636, 0.018199684098362923, 0.021254926919937134, 0.008937789127230644, 0.019770439714193344, 0.014612373895943165, 0.025392144918441772, 0.008553288877010345, 0.02672257274389267, 0.014381897635757923, 0.028525186702609062, 0.009463205002248287, 0.018345575779676437, 0.013412349857389927, 0.01755409687757492, 0.028795653954148293, 0.016135456040501595, 0.02969137206673622, 0.023691346868872643, 0.04504988342523575, 0.020145658403635025, 0.02947578951716423, 0.040626417845487595, 0.1575569361448288, 0.015421013347804546, 0.0390767902135849, 0.04047716408967972], [0.04692164808511734, 0.03763464465737343, 0.011839073151350021, 0.011346008628606796, 0.02508770301938057, 0.01782461628317833, 0.018559256568551064, 0.02633930742740631, 0.029734810814261436, 0.04938551038503647, 0.024777403101325035, 0.03704630583524704, 0.02066807635128498, 0.022683512419462204, 0.024976380169391632, 0.027973396703600883, 0.018214505165815353, 0.021603349596261978, 0.018086783587932587, 0.028482841327786446, 0.015922142192721367, 0.0178762786090374, 0.017423776909708977, 0.020784838125109673, 0.01144589763134718, 0.01787237636744976, 0.01824517920613289, 0.017843537032604218, 0.01672028750181198, 0.017644546926021576, 0.024019908159971237, 0.02127358876168728, 0.01870734430849552, 0.018010511994361877, 0.029355527833104134, 0.025406936183571815, 0.03354170545935631, 0.05899152532219887, 0.07972896844148636], [0.018145807087421417, 0.02191121317446232, 0.006010712124407291, 0.0050897905603051186, 0.022817181423306465, 0.01219047512859106, 0.007013220805674791, 0.007992517203092575, 0.009156091138720512, 0.010565056465566158, 0.008335995487868786, 0.040094584226608276, 0.006840541027486324, 0.007624827325344086, 0.0068575721234083176, 0.028625095263123512, 0.006999027915298939, 0.008275159634649754, 0.007032744586467743, 0.03072705864906311, 0.008638461120426655, 0.009576991200447083, 0.0063989851623773575, 0.025592271238565445, 0.010509785264730453, 0.014061706140637398, 0.01588624343276024, 0.010652532801032066, 0.08823447674512863, 0.013198206201195717, 0.020953761413693428, 0.012509376741945744, 0.10182365030050278, 0.019963780418038368, 0.027521517127752304, 0.019861042499542236, 0.24059930443763733, 0.027166375890374184, 0.03158830106258392, 0.022958552464842796], [0.042368147522211075, 0.03742741420865059, 0.011721329763531685, 0.009725152514874935, 0.029497893527150154, 0.019850213080644608, 0.022893356159329414, 0.027950910851359367, 0.023978354409337044, 0.02561163529753685, 0.013361128978431225, 0.06270426511764526, 0.016536472365260124, 0.020847728475928307, 0.009991137310862541, 0.04908992722630501, 0.0118551729246974, 0.01350922230631113, 0.008686461485922337, 0.049634531140327454, 0.01141072902828455, 0.011430052109062672, 0.007494030985981226, 0.03536127135157585, 0.01605093851685524, 0.00999829825013876, 0.013625686056911945, 0.00861162319779396, 0.025758221745491028, 0.012558260932564735, 0.013093535788357258, 0.009043917059898376, 0.030319925397634506, 0.014312352985143661, 0.015327982604503632, 0.008904405869543552, 0.03060459904372692, 0.021852955222129822, 0.04441773146390915, 0.01588016003370285, 0.13670283555984497], [0.026546742767095566, 0.03074135072529316, 0.0076278322376310825, 0.005896252114325762, 0.01703653112053871, 0.0129587696865201, 0.014452856034040451, 0.020470689982175827, 0.0216459222137928, 0.022817041724920273, 0.010705389082431793, 0.02301623299717903, 0.014453339390456676, 0.016541382297873497, 0.006982330698519945, 0.016962608322501183, 0.01153047475963831, 0.017457373440265656, 0.006997311022132635, 0.023362092673778534, 0.01234087161719799, 0.018261225894093513, 0.007555398158729076, 0.01582743227481842, 0.012104104273021221, 0.013575062155723572, 0.01888303831219673, 0.010290802456438541, 0.024392826482653618, 0.018442358821630478, 0.024473246186971664, 0.02112126722931862, 0.021562393754720688, 0.025122210383415222, 0.06806859374046326, 0.020466849207878113, 0.037530262023210526, 0.027722099795937538, 0.15318669378757477, 0.02737254835665226, 0.05517629161477089, 0.038321930915117264]]})\n",
       "\n",
       "             }, function (err) {\n",
       "                console.log(err);\n",
       "            })"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output.primary_attributions(attr_method='grad_x_input', style=\"detailed\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "colab": {
   "authorship_tag": "ABX9TyNMd2pM9pAx9vddAE9PqoYa",
   "collapsed_sections": [],
   "include_colab_link": true,
   "name": "Ecco-Input-saliency.ipynb",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.12"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "01e1163950684dc6b7fa868e7b9315a4": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HTMLModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HTMLModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HTMLView",
      "description": "",
      "description_tooltip": null,
      "layout": "IPY_MODEL_14dd95b6e25b462e87175be869146d05",
      "placeholder": "​",
      "style": "IPY_MODEL_ff801625f32e452e84c2bcefccabbad3",
      "value": " 1.04M/1.04M [00:00&lt;00:00, 2.09MB/s]"
     }
    },
    "03de4b4c35ce4b3a87f0b06743707c65": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "0e6405015df340b3bdc58694ebd4ecf4": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "1198ffa7ad12484f9ac4048835321335": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "FloatProgressModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "FloatProgressModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "ProgressView",
      "bar_style": "success",
      "description": "Downloading: 100%",
      "description_tooltip": null,
      "layout": "IPY_MODEL_ea23401f422c4201a2ccd2a45c426d52",
      "max": 762,
      "min": 0,
      "orientation": "horizontal",
      "style": "IPY_MODEL_9254b1b515654fe9be6ffc08c2b15e4b",
      "value": 762
     }
    },
    "14dd95b6e25b462e87175be869146d05": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "2d5ded1ce3034928b9675c598f5144e6": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HBoxModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HBoxModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HBoxView",
      "box_style": "",
      "children": [
       "IPY_MODEL_31a4e3758a474c3da4a49bd5c4c396a4",
       "IPY_MODEL_deaba8a37b4a40e2a5e42c8e4044f5ef"
      ],
      "layout": "IPY_MODEL_03de4b4c35ce4b3a87f0b06743707c65"
     }
    },
    "31a4e3758a474c3da4a49bd5c4c396a4": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "FloatProgressModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "FloatProgressModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "ProgressView",
      "bar_style": "success",
      "description": "Downloading: 100%",
      "description_tooltip": null,
      "layout": "IPY_MODEL_a573b926127f471d90552617dbd355ac",
      "max": 456318,
      "min": 0,
      "orientation": "horizontal",
      "style": "IPY_MODEL_41e537de9f8c4912a59ec4dc30e405f5",
      "value": 456318
     }
    },
    "41e537de9f8c4912a59ec4dc30e405f5": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "ProgressStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "ProgressStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "bar_color": null,
      "description_width": "initial"
     }
    },
    "59c41cdb09dc43448f8cf3b3edacc9f6": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "FloatProgressModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "FloatProgressModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "ProgressView",
      "bar_style": "success",
      "description": "Downloading: 100%",
      "description_tooltip": null,
      "layout": "IPY_MODEL_ff151fd817e84f939614c8001ea02384",
      "max": 352833716,
      "min": 0,
      "orientation": "horizontal",
      "style": "IPY_MODEL_6f42cc0bd0414b09994f8ca293b31db3",
      "value": 352833716
     }
    },
    "5a022265356840a5a3fb60ec1ab69d9f": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "FloatProgressModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "FloatProgressModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "ProgressView",
      "bar_style": "success",
      "description": "Downloading: 100%",
      "description_tooltip": null,
      "layout": "IPY_MODEL_a9682d37555846aeb124b69cf38092c3",
      "max": 1042301,
      "min": 0,
      "orientation": "horizontal",
      "style": "IPY_MODEL_6b92f7b5d29e4fa786f03c9a6267cec4",
      "value": 1042301
     }
    },
    "5e4aa51d413b4004bee30cce914d193e": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "5fd6963056bf4687a15c941d3be3494b": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HBoxModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HBoxModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HBoxView",
      "box_style": "",
      "children": [
       "IPY_MODEL_5a022265356840a5a3fb60ec1ab69d9f",
       "IPY_MODEL_01e1163950684dc6b7fa868e7b9315a4"
      ],
      "layout": "IPY_MODEL_9a961b8a92334bedaeda460e4c92befc"
     }
    },
    "66ee7dd681184981a67e2b9dd5fdd6f0": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HBoxModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HBoxModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HBoxView",
      "box_style": "",
      "children": [
       "IPY_MODEL_1198ffa7ad12484f9ac4048835321335",
       "IPY_MODEL_819c4c5a5b3349bcade558a02106c0c4"
      ],
      "layout": "IPY_MODEL_0e6405015df340b3bdc58694ebd4ecf4"
     }
    },
    "6b92f7b5d29e4fa786f03c9a6267cec4": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "ProgressStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "ProgressStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "bar_color": null,
      "description_width": "initial"
     }
    },
    "6f42cc0bd0414b09994f8ca293b31db3": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "ProgressStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "ProgressStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "bar_color": null,
      "description_width": "initial"
     }
    },
    "7d93ca3793fb43ba824f743aa9a7c208": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "DescriptionStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "DescriptionStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "description_width": ""
     }
    },
    "819c4c5a5b3349bcade558a02106c0c4": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HTMLModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HTMLModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HTMLView",
      "description": "",
      "description_tooltip": null,
      "layout": "IPY_MODEL_5e4aa51d413b4004bee30cce914d193e",
      "placeholder": "​",
      "style": "IPY_MODEL_e0fcf661019f4e3da00175887b431ccc",
      "value": " 762/762 [00:00&lt;00:00, 17.0kB/s]"
     }
    },
    "9254b1b515654fe9be6ffc08c2b15e4b": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "ProgressStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "ProgressStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "bar_color": null,
      "description_width": "initial"
     }
    },
    "9a961b8a92334bedaeda460e4c92befc": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "a33793da690a401f84cfc27fe66b58d3": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HTMLModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HTMLModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HTMLView",
      "description": "",
      "description_tooltip": null,
      "layout": "IPY_MODEL_cdc358ab0d7b4cb3b911102f5b5ea48f",
      "placeholder": "​",
      "style": "IPY_MODEL_bc6eb47a66bc4fbe88efa7878e1fd02e",
      "value": " 353M/353M [00:06&lt;00:00, 53.4MB/s]"
     }
    },
    "a573b926127f471d90552617dbd355ac": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "a7f991e0d30b4a2bbdf4efe3085b60ec": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "a9682d37555846aeb124b69cf38092c3": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "b54a170e8e20428dbd08dcbececa6174": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HBoxModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HBoxModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HBoxView",
      "box_style": "",
      "children": [
       "IPY_MODEL_59c41cdb09dc43448f8cf3b3edacc9f6",
       "IPY_MODEL_a33793da690a401f84cfc27fe66b58d3"
      ],
      "layout": "IPY_MODEL_a7f991e0d30b4a2bbdf4efe3085b60ec"
     }
    },
    "bc6eb47a66bc4fbe88efa7878e1fd02e": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "DescriptionStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "DescriptionStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "description_width": ""
     }
    },
    "cdc358ab0d7b4cb3b911102f5b5ea48f": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "dde55076d6544256b821e4364e787a7f": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "deaba8a37b4a40e2a5e42c8e4044f5ef": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "HTMLModel",
     "state": {
      "_dom_classes": [],
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "HTMLModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/controls",
      "_view_module_version": "1.5.0",
      "_view_name": "HTMLView",
      "description": "",
      "description_tooltip": null,
      "layout": "IPY_MODEL_dde55076d6544256b821e4364e787a7f",
      "placeholder": "​",
      "style": "IPY_MODEL_7d93ca3793fb43ba824f743aa9a7c208",
      "value": " 456k/456k [00:00&lt;00:00, 2.34MB/s]"
     }
    },
    "e0fcf661019f4e3da00175887b431ccc": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "DescriptionStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "DescriptionStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "description_width": ""
     }
    },
    "ea23401f422c4201a2ccd2a45c426d52": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "ff151fd817e84f939614c8001ea02384": {
     "model_module": "@jupyter-widgets/base",
     "model_name": "LayoutModel",
     "state": {
      "_model_module": "@jupyter-widgets/base",
      "_model_module_version": "1.2.0",
      "_model_name": "LayoutModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "LayoutView",
      "align_content": null,
      "align_items": null,
      "align_self": null,
      "border": null,
      "bottom": null,
      "display": null,
      "flex": null,
      "flex_flow": null,
      "grid_area": null,
      "grid_auto_columns": null,
      "grid_auto_flow": null,
      "grid_auto_rows": null,
      "grid_column": null,
      "grid_gap": null,
      "grid_row": null,
      "grid_template_areas": null,
      "grid_template_columns": null,
      "grid_template_rows": null,
      "height": null,
      "justify_content": null,
      "justify_items": null,
      "left": null,
      "margin": null,
      "max_height": null,
      "max_width": null,
      "min_height": null,
      "min_width": null,
      "object_fit": null,
      "object_position": null,
      "order": null,
      "overflow": null,
      "overflow_x": null,
      "overflow_y": null,
      "padding": null,
      "right": null,
      "top": null,
      "visibility": null,
      "width": null
     }
    },
    "ff801625f32e452e84c2bcefccabbad3": {
     "model_module": "@jupyter-widgets/controls",
     "model_name": "DescriptionStyleModel",
     "state": {
      "_model_module": "@jupyter-widgets/controls",
      "_model_module_version": "1.5.0",
      "_model_name": "DescriptionStyleModel",
      "_view_count": null,
      "_view_module": "@jupyter-widgets/base",
      "_view_module_version": "1.2.0",
      "_view_name": "StyleView",
      "description_width": ""
     }
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
